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) )
Anonymous
2 years agoNot applicable
Hi jayjay0306
I understand your requirement, but according to your description, your data comes from three tables, I am not quite sure about the table structure of your three tables, can you provide me with this information? You can refer to the following link to provide the data: How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Or show it as a screenshot or excel. Please remove any sensitive data in advance.
Best Regards,
Community Support Team _Yuliax