Forum Discussion

PBIfanatic's avatar
PBIfanatic
Icon for Helper V rankHelper V
5 years ago
Solved

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]))
 
 
  • PBIfanatic 

    please try this

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

2 Replies

  • PBIfanatic 

    please try this

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