Forum Discussion

slackerhx's avatar
slackerhx
Icon for Helper II rankHelper II
4 years ago
Solved

Dynamic calculations according to slicer value

Hi All,    I'm getting a bit rusty with DAX calculations and will need help from the community.    I'm trying to get the column of values (Workstations Required) recalculated based on the chosen ...
  • v-yanjiang-msft's avatar
    v-yanjiang-msft
    3 years ago

    Hi slackerhx ,

    According to your description, in the chart, the Year column is in the X-axis, so you shouldn't use "ALLSELECTED([Year])" in the formula, which will ignore current year in the X-axis and take all years into consideration.

    Modify the formula to:

    Measure =
    CALCULATE ( SUM ( Table1[HC] ), ALLSELECTED ( Table1[ID] ) )
        * SELECTEDVALUE ( 'Agility Ratio'[Agility Ratio] )
    

    Get the correct result in my sample.

    Best Regards,
    Community Support Team _ kalyj

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