View Single Post
 
Old 06-25-2018, 10:13 PM
ArviLaanemets ArviLaanemets is offline Windows 8 Office 2016
Expert
 
Join Date: May 2017
Posts: 949
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Quote:
I need to find the comparable sales for YTD and MTD based on the opening date
I have't a clue what this means!?

Anyway, I try:

I prefer to use SUMIFS(), and as this function uses column references and doesn't allow expressions (like [Qty]*[Ext. Price]) instead, some additional columns are needed (you can hide them).
I assume the result table is a defined Table too.

Into source table (Table1), add columns like
Sum = [@Qty]*[@[Ext. Price]]
TY = AND(Iif(YEAR([@[Opening Date]] = YEAR(TODAY()), [@[Comp Date]], [@[Opening Date]])<[@Date],YEAR([@Date])=YEAR(TODAY()))

In result table, the formula for TY YTD sales will be like
Code:
=SUMIFS(Table1[Sum], Table1[Store],[@Store],Table1[TY], TRUE)
Reply With Quote