Forum Discussion
jayjay0306
Helper III
2 years agoHow do I sum index on multiple dates?
Hi people, I hope you can help me with a complex DAX problem: I have a report based on the following tables: D_Customer D_Date F_Sale Each customer has day-to-day sale in the table: exampl...
- 2 years ago
untested, but try something like this:
AVERAGEX( CALCULATETABLE(VALUES('Calendar'[date]), ALLSELECTED('Calendar'[date]), 'Calendar'[Marked_Date]), VAR varReportDate = CALCULATE(MAX('Calendar'[date])) VAR Summinus14= CALCULATE( SUM( 'Sales'[Sales] ), FILTER( ALL( 'Calendar'[date] ), 'Calendar'[date] >= varReportDate-14&&'Calendar'[date] < varReportDate ) ) VAR Sumplus14= CALCULATE( SUM( 'Sales'[Sales] ), FILTER( ALL( 'Calendar'[date] ), 'Calendar'[date] <= varReportDate+14&&'Calendar'[date] > varReportDate ) ) RETURN DIVIDE(Sumplus14,Summinus14) )
jayjay0306
Helper III
2 years agoHi Sjoerdvn, it works! brilliant! thank you so much 🙂
and thank you, v-xuxinyi-msft, for getting back.
Have a nice day, both.
br,
Jayjay0306