Forum Discussion
Dax help
- 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.
Hi sameergupta60 ,
Sorry for that the information you have provided is not making the problem clear to me. What's the meaning of
1.my RCC works on level r13, [01 RCC] has date value when [Levels]="R13"?
2.then BW at least on level r10, need a value? for [02 BW] when [Levels]="R10"?
3. but it is on level R04 need to highlight , based on your screenshot ,you directed to R05 not R04?
And from this: I have to measure the difference between the two-column. It seems that you want to calculate the diff of [Slab Cycle] between R13 and R04.
R13 is the maximum level.
R04 is R13 minus 9
If so, please try:
Max level -9 = var _maxLevel= MAXX(ALL('Table'),[Levels])
var _levelMinus9= RIGHT(_maxLevel,2)-9
return "R"&FORMAT(_levelMinus9,"00") Diff =
var _maxLevel= MAXX(ALL('Table'),[Levels])
return CALCULATE(SUM('Table'[Slab Cycle]),FILTER('Table',[Levels]=_maxLevel))- CALCULATE(SUM('Table'[Slab Cycle]),FILTER('Table',[Levels]=[Max level -9]))
For conditional formatting:
Color = IF(MAX('Table'[Levels])=[Max level -9],"Green")
Output:
Or if it's not your expected, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
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.
- sameergupta604 years agoHelper IV
hi,
thanks for the reply.
my RCC works on level r13, [01 RCC] has date value when [Levels]="R13"? if my work is completed on level R13 or any other level then my BW should be below 3 levels but in current data, it is on R04 or r05 so we have to highlight that schedule should be on R10 level with color.
2.then BW at least on level r10, need a value? for [02 BW] when [Levels]=" R10"? we need to highlight the same on R10 of BW with color