Forum Discussion
sameergupta60
Helper IV
4 years agoDax 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....
- Anonymous4 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.
Anonymous
4 years agoNot applicable
Hi sameergupta60 ,
Such error is caused by two strange value in your data:
Can we ignore both?
Try to create the columns in Power Query instead:
Text.Select([Levels],{"0".."9"})if [Rank]<>null then Text.Start([Levels],1) else null
Don't forget to change the Rank type to Number:
Then try:
Measure 2 = var _maxLevel= MAXX(FILTER(ALLSELECTED('Table'),[Type]=MAX('Table'[Type])),[Rank])
var _levelMinus3= _maxLevel-3
var _LastBWDate=MAXX(FILTER(ALL('Table'), [Type]=MAX('Table'[Type]) &&[02 BW]<>BLANK()),[02 BW])
var _LastBWLevel= CALCULATE(MAX('Table'[Rank]),FILTER(ALLSELECTED('Table'), [Type]=MAX('Table'[Type]) && [02 BW]=_LastBWDate))
return IF(MAX('Table'[Levels])=MAX('Table'[Type]) & FORMAT(_LastBWLevel,"00"), IF(_levelMinus3> _LastBWLevel,"Red"))
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.