Hello,
Is it possible to sum the monthly results in a grand total for a formula using intersect?
I have this result from an intersect evaluated monthly:
Problem
but the grand total is not the sum of the months. I tried EVERYTHING! I can’t get the Sumx or AverageX to produce a sensible result.
while I understand these are iterating functions, I don’t understand why it won’t work if I use a virtual table:
SUMMARIZE (
‘D-Orders’,
‘D-Orders’[Year.Month],
‘!Dates (Core Table)’[Date].[Year],
‘!Dates (Core Table)’[Date].[Month],
‘D-Orders’[storeId],
‘D-Orders’[store_name],
“Whatever”, CountRowPrime)
Background Formulas:
VAR PrevUSERTBL = CALCULATETABLE(VALUES(‘D-Orders’[customerId]),DATEADD(‘!Dates (Core Table)’[Date].[Date],-1,MONTH))
Var CurrentUserTBL =CALCULATETABLE(VALUES(‘D-Orders’[customerId]),FILTER(‘!Dates (Core Table)’,‘!Dates (Core Table)’[Date]<=MAX(‘!Dates (Core Table)’[Date])))
Var PreviousMonthCrossReference = INTERSECT(CurrentUserTBL,PrevUSERTBL)
var CountRowPrime = COUNTROWS(PreviousMonthCrossReference)
RETURN
AVERAGEX(STable,[Whatever])
//this is the formula that creates the result in the firt image
Background Context
I used the intersect formula from the Var tables listed above to see how many customers return in the next month (consecutive month purchasers). In aggregate, I would like to determine what that amount is on average YTD. Or even the Sum YTD.
I was able to do this in excel easily but dax???