Forum Discussion

EthanLansera's avatar
EthanLansera
Regular Visitor
1 year ago
Solved

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 ap...
  • anilelmastasi's avatar
    1 year ago

    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.