Forum Discussion

BIBRO's avatar
BIBRO
Frequent Visitor
4 years ago
Solved

Switch measures based on column value

I want to use a different measure based on the year. If Year = max(year) then use measure 1 else use measure 2.   In the example below measure 3 uses measure 1 for Max(Year) and measure 2 for the r...
  • amitchandak's avatar
    4 years ago

    BIBRO , In such case the selected value has come from an independent year table

     

    if(SELECTEDVALUE(year[year]) = MAX(table[year]),[measure 1],[measure 2])

     

    Measure =

    var _max  =maxx(allselected(year), year[year])

    return

    if(_max = MAX(table[year]),[measure 1],[measure 2])

     

    Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI