Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi
How you would interpret this conditional formatting rule which highlight the highest number? How you would write one which will highlight the lowest number. Any help would be very much appreciated. Thank you very much.
Solved! Go to Solution.
Hi, @lastnn30
Create a measure to evaluate it:
LowestCountHighlight =
var ValuesDisplay =
CALCULATETABLE(
ADDCOLUMNS(
SUMMARIZE(SafetyData, SafetyData[Injury Location],SafetyData[Incident Type]),
"CountOfIncidentTYpe", CALCULATE(COUNTROWS(SafetyData), ALLEXCEPT(SafetyData, SafetyData[Injury Location]))),
ALLSELECTED()
)
var MinCOunt = CALCULATE(MINX(ValuesDisplay, [CountOfIncidentTYpe]))
var MaxCount = CALCULATE(MAXX(ValuesDisplay, [CountOfIncidentTYpe]))
var CurrentValue = COUNTROWS(SafetyData)
var Result =
SWITCH(TRUE(),
CurrentValue = MinCOunt, "#F00",
CurrentValue = MaxCount, "#0F0"
)
return Result
Then use - Field Value in the Conditional formatting:
Or if you wanna have more control, you can return 1 and 2 (1 = min, 2 = max) and then in Conditional formatting -> Rules, you can setup the colors accordingly (if value = 2 then some color etc.)
Hi @lastnn30 ,
Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team _ kalyj
Hi, @lastnn30
Create a measure to evaluate it:
LowestCountHighlight =
var ValuesDisplay =
CALCULATETABLE(
ADDCOLUMNS(
SUMMARIZE(SafetyData, SafetyData[Injury Location],SafetyData[Incident Type]),
"CountOfIncidentTYpe", CALCULATE(COUNTROWS(SafetyData), ALLEXCEPT(SafetyData, SafetyData[Injury Location]))),
ALLSELECTED()
)
var MinCOunt = CALCULATE(MINX(ValuesDisplay, [CountOfIncidentTYpe]))
var MaxCount = CALCULATE(MAXX(ValuesDisplay, [CountOfIncidentTYpe]))
var CurrentValue = COUNTROWS(SafetyData)
var Result =
SWITCH(TRUE(),
CurrentValue = MinCOunt, "#F00",
CurrentValue = MaxCount, "#0F0"
)
return Result
Then use - Field Value in the Conditional formatting:
Or if you wanna have more control, you can return 1 and 2 (1 = min, 2 = max) and then in Conditional formatting -> Rules, you can setup the colors accordingly (if value = 2 then some color etc.)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 25 |
| User | Count |
|---|---|
| 124 | |
| 87 | |
| 70 | |
| 66 | |
| 65 |