Forum Discussion
Cumulative sum - what am I doing wrong?
Below is a screenshot of my data. Let me start by explaining what my end goal is and what I've done so far to get there.
I would like to show where we stand YTD for 2018 compared to previous years. Ultimately I'd like a graph that displays the months across the x-axis and the cumulative sum of donations on the y-axis with a line for each year. I'd also like to do a similar chart for the count of donations.
I figured I would start by doing a running sum total of donation amount. I used the quick measure option and selected donation amount as my base, updating with every change in invoice date. I copied the formula into a column, which is what you see below... and it doesn't appear to be working as I expected.
I expected to see:
1/5/2015 50
1/6/2015 25
1/6/2015 10025
1/6/2015 10030
1/6/2015 10155
1/12/2015 250 and so on...
Did I miss something or am I thinking about this all wrong? New to power bi and limited knowledge of DAX.
2 Replies
- Seward12533
Solution Sage
Your close. A few comments. If you just want to display on a visual you probalby just want to create a measure vs a calculated column as its much more efficient (only calculates when you need it)
Fot he time intelligence you need to have a date table which you can build with DAX CALNEDAR function.
Then you write a measure for a CUMULATIVE. Check out this article I think it will help you https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/
- v-jiascu-msft
Microsoft Employee
Hi ksan,
I would suggest you use a measure instead of the calculated column and also try the function dax/totalmtd-function-dax.
Best Regards,
Dale