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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PBIfanatic
Helper V
Helper V

Cumulative total for multiple dimensions

Hi all, 

 

How do we find the cumulative sum, when we have repeating rows of data for a dimension?

eg: 

 

I have the following data -  date, country and cases. 

 

01/01/20  US   100

01/01/20 UAE   10

01/01/20  FR     20

 

02/01/20  US   100

02/01/20 UAE   10

02/01/20  FR     20

 

When I do a cumulative sum of cases, I get the sum of the total cases for 01/01/20 repeated for the number of rows (130*3) and the cumulative sum is all wrong. 

This is the calculated column being used. 

Cumulative = CALCULATE(sum(Summary[Cases]), FILTER(Summary),Summary[date] <= EARLIER(Summary[date]))
 
 
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@PBIfanatic 

please try this

Cumulative = CALCULATE(sum(Summary[Cases]), FILTER(Summary),Summary[date] <= EARLIER(Summary[date])&&country =earlier(country))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@PBIfanatic 

please try this

Cumulative = CALCULATE(sum(Summary[Cases]), FILTER(Summary),Summary[date] <= EARLIER(Summary[date])&&country =earlier(country))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu  perfect!!

thanks v much.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.