Forum Discussion

jedlewis12345's avatar
jedlewis12345
Regular Visitor
3 years ago
Solved

Get Variance from the same column

Hi all, I have my data laid out in the following format: There are 2 years of data - 2022 Actuals and 2023 Budget. How would i get a Card Visual to display the variance for Actua...
  • DataInsights's avatar
    3 years ago

    jedlewis12345,

     

    Try this measure:

     

    Variance =
    VAR vActuals =
        CALCULATE ( SUM ( Table1[Value] ), Table1[Actuals/Budget] = "Actuals" )
    VAR vBudget =
        CALCULATE ( SUM ( Table1[Value] ), Table1[Actuals/Budget] = "Budget" )
    VAR vResult = vBudget - vActuals
    RETURN
        vResult
  • DataInsights's avatar
    DataInsights
    3 years ago

    jedlewis12345,

     

    Since you are trying to slice by different years simultaneously, you'll have to create separate Year tables to use for slicers. Alternatively, you could create a column Reporting Year and populate it with 2022 for the "2022 Actuals" and "2023 Budget" rows. Then you could slice by Reporting Year.