cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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.

 Id Date Sale Result 1 20.10.2023 1 1 1 24.10.2023 2 3 1 10.11.2023 2 5 2 10.11.2023 2 2 2 11.11.2023 2 2 3 21.10.2023 1 1

Thank you

Marcin

1 ACCEPTED SOLUTION
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.

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.

3 REPLIES 3
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.

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.

Helper II

hi,

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

Super User

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

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors