Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ksan
New Member

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.

powerbi.JPG

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 2
v-jiascu-msft
Employee
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

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Seward12533
Solution Sage
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/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.