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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Irek
Helper II
Helper II

Rolling Total by date and category.

Hi, 

 

How to calculate rolling/cummulative  sum by date and category (in my case ID) ?

I have worker ID and date, need to get rolling for each employee. 

IdDateSaleResult
120.10.202311
124.10.202323
110.11.202325
210.11.202322
211.11.202322
321.10.202311



 

Thank you

Marcin

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Irek ,

 

Calculated Column:

C_Result = CALCULATE(SUM('Table'[Sale]),FILTER(ALLEXCEPT('Table','Table'[Id]),'Table'[Date]<=EARLIER('Table'[Date])))

Measure:

M_Result = CALCULATE(SUM('Table'[Sale]),FILTER(ALLEXCEPT('Table','Table'[Id]),'Table'[Date]<=MAX('Table'[Date])))

Result is as below.

vrzhoumsft_0-1700555494441.png

vrzhoumsft_1-1700555501676.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Irek ,

 

Calculated Column:

C_Result = CALCULATE(SUM('Table'[Sale]),FILTER(ALLEXCEPT('Table','Table'[Id]),'Table'[Date]<=EARLIER('Table'[Date])))

Measure:

M_Result = CALCULATE(SUM('Table'[Sale]),FILTER(ALLEXCEPT('Table','Table'[Id]),'Table'[Date]<=MAX('Table'[Date])))

Result is as below.

vrzhoumsft_0-1700555494441.png

vrzhoumsft_1-1700555501676.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

hi, 

 

I figured the solution some time ago but yours also works very well, thank you. 

lbendlin
Super User
Super User

Please use Quick Measures - they have examples for Rolling Totals.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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