Forum Discussion
Jay0610
4 years agoFrequent Visitor
Cumulative Totals
Hi, I'm struggling with the DAX for calculating the monthly cumulative shown below. (resets on each month) Ive tried using the following but no joy! Any help would be really appreci...
- 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
Jay0610
4 years agoFrequent Visitor
Excellent thanks Ashish, Im starting to see the importance of calendar tables!
Ashish_Mathur
Super User
4 years agoYou are welcome.