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
kimpanu
Frequent Visitor

Running/Cumulative total by multiple group

Hi,

 

Iam stucked into get cumluative/running total of an table with multiple group columns. Table looks like this:

 

Category 1Category 2AccountDateAmount
Cat1-Number1Cat2-Number130102018-0710
Cat1-Number1Cat2-Number130102018-085
Cat1-Number1Cat2-Number130102018-0950
Cat1-Number1Cat2-Number130102018-1090
Cat1-Number1Cat2-Number230112018-0790
Cat1-Number1Cat2-Number230112018-08100
Cat1-Number2Cat2-Number130122018-08100

 

Then i want running total should be:

Cat1-Number1 => Cat2-Number1 => 3010 => 155

Cat1-Number1 => Cat2-Number2 => 3011 => 190

Cat1-Number2 => Cat2-Number1 => 3012 => 100

 

I have try this formula but that want be correct:

=CALCULATE(SUM('Table'[Amount]), FILTER(ALLEXCEPT('Table', 'Table'[Account]), 'Table'[Date] >= EARLIER('Table'[Date])))

Thats had work if o only got Account as group but now i have Category 1 and Category 2 also. 

 

So how should i think to resolve this one?

1 ACCEPTED SOLUTION
kimpanu
Frequent Visitor

I figure it out. This is the correct formula:

=CALCULATE(SUM('Table'[Amount]), FILTER(ALLEXCEPT('Table', 'Table'[Account], 'Table'[Category1], 'Table'[Category2]), 'Table'[Date] <= EARLIER('Table'[Date])))

View solution in original post

1 REPLY 1
kimpanu
Frequent Visitor

I figure it out. This is the correct formula:

=CALCULATE(SUM('Table'[Amount]), FILTER(ALLEXCEPT('Table', 'Table'[Account], 'Table'[Category1], 'Table'[Category2]), 'Table'[Date] <= EARLIER('Table'[Date])))

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.