cancel
Showing results for
Search instead for
Did you mean:
Helper IV

## 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
Super User II

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!

2 REPLIES 2
Super User II

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!

Helper IV

@ryan_mayu  perfect!!

thanks v much.

## Helpful resources

Announcements

#### Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

#### Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

#### Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors