Forum Discussion
Cumulative Totals
- 4 years ago
Hi,
Assuming Date and Margin are columns already present in your source data table, perform the following steps:
- Create a Calendar Table
- Build a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of your Calendar Table
- To your Table/Matrix visual, drag Date from the Calendar Table
- Write these measures:
Total = sum(Data[Margin])
MTD Total = calculate([Total],datesmtd(calendar[date]))
Hope this helps.
- 4 years ago
Hi Ashish, I decided to group by date in power query as that was effectively what I was doing on the table visual in power BI. I was then able to use your method for cumulative totals on the daily target. Many thanks for your assistance with this, really appreciated
Hi,
Assuming Date and Margin are columns already present in your source data table, perform the following steps:
- Create a Calendar Table
- Build a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of your Calendar Table
- To your Table/Matrix visual, drag Date from the Calendar Table
- Write these measures:
Total = sum(Data[Margin])
MTD Total = calculate([Total],datesmtd(calendar[date]))
Hope this helps.
Excellent thanks Ashish, Im starting to see the importance of calendar tables!
- Ashish_Mathur4 years agoSuper User
You are welcome.