Forum Discussion

cborde3's avatar
cborde3
Frequent Visitor
3 years ago
Solved

Running Totals for Two Years

Hello, I'm trying to display the running total of errors for two years in a line graph so that they can be compared. I need  a visual similar to this:     My calculation for 2023 is:   2...
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    You may download my PBI file from here.

    Hope this helps.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi cborde3 ,

    You can update the formula of measure as below to get the culmulative values, please find the details in the attachment.. If you want to get the value for the specific year, you can add the condition: YEAR(_seldate)=2022 to get it.

    Sample 2022 Cumulative Errors = 
    VAR _seldate =
        SELECTEDVALUE ( 'Calendar'[Date] )
    RETURN
        CALCULATE (
            SUM ( Sheet1[Distinct] ),
            FILTER ( ALLSELECTED ( Sheet1 ), 'Sheet1'[Date] <= _seldate )
        )

    Best Regards