Forum Discussion
jaythakur32
2 years agoNew Member
How to highlight maximum and minimum values?
Hi, I am new to PBI and find it difficult to highlight the maximum and minimum values row-wise using DAX in the visual (matrix table). I have rows as Product Names from the Product table, columns ...
- Anonymous2 years ago
Hi jaythakur32
Based on your needs, I have created the following table.
You can use the following dax to get the result you want.
Measure 2 = var _tab=SUMMARIZE(ALLSELECTED('Table (2)'[area]),'Table (2)'[area], "@sumvalue",CALCULATE(SUM('Table (2)'[value]))) var _max= maxx( _tab,[@sumvalue]) var _min= MINX(_tab,[@sumvalue]) var _area=SELECTEDVALUE('Table (2)'[area]) return SWITCH(TRUE(),sum('Table (2)'[Value])=_max&&_area="a","grey", sum('Table (2)'[Value])=_max&&_area= "b","grey",sum('Table (2)'[Value])=_max&&_area="c","grey",sum('Table (2)'[Value])=_max&&_area="d","grey",sum('Table (2)'[Value])=_min&&_area="a","green", sum('Table (2)'[Value])=_min&&_area= "b","green",sum('Table (2)'[Value])=_min&&_area="c","green",sum('Table (2)'[Value])=_min&&_area="d","green")Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
2 years agoNot applicable
Hi jaythakur32
Based on your needs, I have created the following table.
You can use the following dax to get the result you want.
Measure 2 = var _tab=SUMMARIZE(ALLSELECTED('Table (2)'[area]),'Table (2)'[area], "@sumvalue",CALCULATE(SUM('Table (2)'[value])))
var _max= maxx( _tab,[@sumvalue])
var _min= MINX(_tab,[@sumvalue])
var _area=SELECTEDVALUE('Table (2)'[area])
return SWITCH(TRUE(),sum('Table (2)'[Value])=_max&&_area="a","grey", sum('Table (2)'[Value])=_max&&_area= "b","grey",sum('Table (2)'[Value])=_max&&_area="c","grey",sum('Table (2)'[Value])=_max&&_area="d","grey",sum('Table (2)'[Value])=_min&&_area="a","green", sum('Table (2)'[Value])=_min&&_area= "b","green",sum('Table (2)'[Value])=_min&&_area="c","green",sum('Table (2)'[Value])=_min&&_area="d","green")
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.