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
req77
Helper I
Helper I

Accumulated sum that resets when the year changes

Hello,

I created a measure that counts the total items per month and it's working fine. This is my measure:

Cumulative_Total =

CALCULATE([Qtd_Total],

    FILTER(ALL('Table'),

        'Table'[Date] <= MAX('Table'[Date])

        )

    )

But I want my chart to reset the count when the user selects only one year in the dashboard year filter.
For example: if he selects only the items from 2022, the chart will start from zero in the month of January, and not take the count of the previous months (2021) and add to the months of the year 2022. How can I do this?

1 ACCEPTED SOLUTION
PVO3
Impactful Individual
Impactful Individual

Please try to include date to your filters like below.

Or (perhapse better) use ALLSELECTED instead of ALL/ALLEXCEPT.

 

 

Cumulative_Total =

CALCULATE([Qtd_Total],

    FILTER(ALLEXCEPT('Table','Table'[Date]),

        'Table'[Date] <= MAX('Table'[Date])

        )

    )

 

 

View solution in original post

1 REPLY 1
PVO3
Impactful Individual
Impactful Individual

Please try to include date to your filters like below.

Or (perhapse better) use ALLSELECTED instead of ALL/ALLEXCEPT.

 

 

Cumulative_Total =

CALCULATE([Qtd_Total],

    FILTER(ALLEXCEPT('Table','Table'[Date]),

        'Table'[Date] <= MAX('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.