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)