Forum Discussion

sameergupta60's avatar
sameergupta60
Helper IV
4 years ago
Solved

Dax help

hi all,    I have to measure the difference between the two-column.   Ex if my RCC works on level r13 then BW at least on level  r10  but it is on level R04 need to highlight the gap on that row....
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi sameergupta60 ,

     

    Please try:

    Measure = 
    var _maxLevel= MAXX(ALL('Table'),[Levels])
    var _levelMinus3= RIGHT(_maxLevel,2)-3
    var _LastBWDate=CALCULATE(LASTDATE('Table'[02 BW]),ALL('Table'))
    var _LastBWLevel= CALCULATE( RIGHT( MAX('Table'[Levels]),2),FILTER(ALL('Table'),[02 BW]=_LastBWDate  ))
    return  IF(MAX('Table'[Levels])="R"&FORMAT(_levelMinus3,"00") , IF(_levelMinus3> CONVERT(_LastBWLevel,INTEGER),"Red"))

    Set Conditional formatting for [Levels] and [02 BW] based on the measure:

    Output:

     

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