Forum Discussion

bburzanko3's avatar
bburzanko3
Regular Visitor
1 year ago
Solved

Change Measures used based on Slicer Selection

Hello - I am trying to set up a dashboard that allows me to select year (2024 or 2025) and based on that the measures in the dashboard change.   I have a static table with a year field containing 2...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi bburzanko3 ,

    I'm not sure how your dataset is designed, here is my sample.

    The data table is as follows.

     

    Create the following measure for dynamic switching of savings.

    SelectedYearSavings = 
    VAR SelectedYear = CALCULATE ( SELECTEDVALUE ( 'Table'[Year] ), ALLSELECTED () )
    RETURN
        SWITCH ( 
            SelectedYear, 
            2024, [2024 Savings], 
            2025, [2025 Savings] 
        )


    The final resutl is as follows. Hopefully it will meet your needs.

     


    Please see the attached pbix for reference.

    Best Regards,
    Dengliang Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.