Forum Discussion

karimkz's avatar
karimkz
Advocate I
9 years ago
Solved

IF statement in Measure, need help

Hi,   I want my Measure to change value, based on a selected Unit. Just like that:    So how do I write something like:            IF (car_id=0109) then Measure=22  (doesn't work this...
  • v-sihou-msft's avatar
    9 years ago

    karimkz

     

    In DAX, Measure is always sliced by current row context, it's not possible to use the current slicing row as condition in Measure. In your scenario, you can create a dummy measure for this conditon. Just create a measure like:

     

    Dummy = SUM(Table[car_id])

     

     

    Then you can create a calculated measure like:

     

    Measure =IF([Dummy]=112,22,[Measure_Gauge])

     

     

    Regards,