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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
EthanLansera
Regular Visitor

Running Total breaks when new year starts

Good afternoon,

I am looking for some advice with my PowerBi visual shown below. I have browsed similar issues on Forums and made minor changes but I have had no luck! Any help would be greatly appreciated.

Issue: The dotted line is the total planned running from Jan 2025 to Jan 2026 however, PowerBi restarts the count when it gets to Jan 2026.

Requirement: Dotted line does not restart and carries on calculating.

 

EthanLansera_1-1738851255480.png

Dotted line formula:

Audit Plan Running Total =
CALCULATE(
    COUNTA('Audit Plan 2023 - 2025 (3 Year Plan)'[Audit Status]),
    FILTER(
        CALCULATETABLE(
            SUMMARIZE(
                'Audit Plan 2023 - 2025 (3 Year Plan)',
                'Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[MonthNo],
                'Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[Month]
            ),
            ALLSELECTED('Audit Plan 2023 - 2025 (3 Year Plan)')
        ),
        ISONORAFTER(
            'Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[MonthNo], MAX('Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[MonthNo]), DESC,
            'Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[Month], MAX('Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[Month]), DESC
        )
    )
)

 

 

 

1 ACCEPTED SOLUTION
anilelmastasi
Super User
Super User

Hello @EthanLansera 

 

Audit Plan Running Total =
CALCULATE(
COUNTA('Audit Plan 2023 - 2025 (3 Year Plan)'[Audit Status]),
FILTER(
ALL('Audit Plan 2023 - 2025 (3 Year Plan)'),
'Audit Plan 2023 - 2025 (3 Year Plan)'[Due by Month] <= MAX('Audit Plan 2023 - 2025 (3 Year Plan)'[Due by Month])
)
)

It uses the ALL() function instead of ALLSELECTED(), ensuring that the calculation considers all dates in the dataset, regardless of filters or selections. By applying FILTER(ALL(Table), [Date] <= MAX([Date])), it accumulates the count continuously across all years rather than resetting at the start of a new year. This allows the running total to persist seamlessly from one year to the next without being affected by slicers or date context changes.

 

If that works, please select as answer!

Thank you.

View solution in original post

2 REPLIES 2
anilelmastasi
Super User
Super User

Hello @EthanLansera 

 

Audit Plan Running Total =
CALCULATE(
COUNTA('Audit Plan 2023 - 2025 (3 Year Plan)'[Audit Status]),
FILTER(
ALL('Audit Plan 2023 - 2025 (3 Year Plan)'),
'Audit Plan 2023 - 2025 (3 Year Plan)'[Due by Month] <= MAX('Audit Plan 2023 - 2025 (3 Year Plan)'[Due by Month])
)
)

It uses the ALL() function instead of ALLSELECTED(), ensuring that the calculation considers all dates in the dataset, regardless of filters or selections. By applying FILTER(ALL(Table), [Date] <= MAX([Date])), it accumulates the count continuously across all years rather than resetting at the start of a new year. This allows the running total to persist seamlessly from one year to the next without being affected by slicers or date context changes.

 

If that works, please select as answer!

Thank you.

Kaviraj11
Super User
Super User

Hi,

 

Use a continuous running total approach: Instead of limiting the logic to a specific month's number, you can calculate the running total based on a unique identifier for each period (e.g., a combination of Year and Month, or just use MonthNo continuously)

 

Audit Plan Running Total =
CALCULATE(
COUNTA('Audit Plan 2023 - 2025 (3 Year Plan)'[Audit Status]),
FILTER(
CALCULATETABLE(
SUMMARIZE(
'Audit Plan 2023 - 2025 (3 Year Plan)',
'Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[MonthNo]
),
ALLSELECTED('Audit Plan 2023 - 2025 (3 Year Plan)')
),
'Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[MonthNo] <= MAX('Audit Plan 2023 - 2025 (3 Year Plan)'[Due By Month].[MonthNo])
)
)

 

MONTHNO as a continuous measure: Instead of considering the month as a standalone entity, we're now focusing on the continuous MonthNo. The MonthNo will not reset at the start of the year, so the running total will simply continue calculating




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.