Forum Discussion
Cumulative Spend
- 4 years ago
Hi KasRotodyne
I recommend that you add a Calendar (Date) table to the model and connect it to the Main table on Date columns. A Date table has continuous unique dates. This can avoid missing data if Main table doesn't have continuous dates for the slicer or axis.
Then build relationships between tables following the star schema
At last, use the following measure to calculate the cumulative value. I have attached a sample file at bottom for your reference. Hope it helps.
Cumulative Amount = VAR _date = MAX('Calendar'[Date]) RETURN CALCULATE(SUM(InvoiceMain[Amount]),ALL('Calendar'),'Calendar'[Date]<=_date)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi KasRotodyne
I recommend that you add a Calendar (Date) table to the model and connect it to the Main table on Date columns. A Date table has continuous unique dates. This can avoid missing data if Main table doesn't have continuous dates for the slicer or axis.
Then build relationships between tables following the star schema
At last, use the following measure to calculate the cumulative value. I have attached a sample file at bottom for your reference. Hope it helps.
Cumulative Amount =
VAR _date = MAX('Calendar'[Date])
RETURN
CALCULATE(SUM(InvoiceMain[Amount]),ALL('Calendar'),'Calendar'[Date]<=_date)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.