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! It's time to submit your entry. Live now!
Hi, I have a matrix table that has a segment with each employee under that segment. I need each segment to identify the max value ( the person with the highest number) with conditional formatting to highlight the value.
I have tried everything but keep only coloring the highest value overall in the column, not by segment. Below are the two dax, I have had tried
Dax 1
Rank = VAR HighestValue = MAXX(ALLSELECTED('table'[Segment], 'table'handlername), [Promoter Count])
RETURN
IF ([Promoter Count]= HighestValue, "Red")
Dax 2
Rank = VAR HighestValue = MAXX(ALL(table'segment, 'table'hnadler name), [Promoter Count])
RETURN
SWITCH(
TRUE(),
MAX('20220421072842-SurveyExport'[Segment]) = "AMD" && [Promoter Count] = HighestValue, "blue",
MAX('20220421072842-SurveyExport'[Segment]) = "Property" && [Promoter Count] = HighestValue, "Yellow",
MAX('20220421072842-SurveyExport'[Segment]) = "Liability" && [Promoter Count] = HighestValue, "Red",
MAX('20220421072842-SurveyExport'[Segment]) = "WC" && [Promoter Count] = HighestValue, "orange")
Hi @eliabreupr ,
I have created a simple sample, please refer to it to see if it helps you.
Create two measures.
Measure =
VAR _maxvalue =
MAXX (
FILTER (
ALL ( 'table' ),
'table'[Segment] = SELECTEDVALUE ( 'table'[Segment] )
),
[Promoter CountME]
)
RETURN
IF ( 'table'[Promoter CountME] = _maxvalue, "Red", BLANK () )
Rank_a =
VAR HighestValue =
MAXX (
FILTER (
ALL ( 'table' ),
'table'[Segment] = SELECTEDVALUE ( 'table'[Segment] )
),
[Promoter CountME]
)
RETURN
SWITCH (
TRUE (),
MAX ( 'table'[Segment] ) = "AMD"
&& [Promoter CountME] = HighestValue, "blue",
MAX ( 'table'[Segment] ) = "Property"
&& [Promoter CountME] = HighestValue, "Yellow",
MAX ( 'table'[Segment] ) = "Liability"
&& [Promoter CountME] = HighestValue, "Red",
MAX ( 'table'[Segment] ) = "WC"
&& [Promoter CountME] = HighestValue, "orange"
)
How to Get Your Question Answered Quickly
If I have misunderstood your meaning, please provide more details with your desired output and pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi! This is close to what I need. For some reason, instead of pointing out the highest value is pointing the lowest when I used the recommended dax. Any idea of why?
Probably because my table under each segment has the employee?
Hi @eliabreupr ,
Please check the measure [Promoter Count]. How did you write your formula? Please return the HighestValue. Check if this formula returns the maximum value.
Rank_a = VAR HighestValue = MAXX(filter(ALL('table'), 'table'[Segment]=SELECTEDVALUE('table'[Segment])), [Promoter CountME])
RETURN HighestValue
//SWITCH( TRUE(), MAX('table'[Segment]) = "AMD" && [Promoter CountME] = HighestValue, "blue",MAX('table'[Segment]) = "Property" &&[Promoter CountME] = HighestValue, "Yellow",MAX('table'[Segment]) = "Liability" && [Promoter CountME] = HighestValue, "Red", MAX('table'[Segment]) = "WC" && [Promoter CountME] = HighestValue, "orange")
Please provide more screenshots with measure [Promoter Count] and the return value.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I noticed that my table structure has segments and employees under each segment, like a matrix summary. It is different from the sample table that you prepare. Maybe that's why my formula and you suggested formula are not working correctly because the structure of my table?
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 44 | |
| 34 | |
| 26 | |
| 23 |
| User | Count |
|---|---|
| 137 | |
| 118 | |
| 58 | |
| 40 | |
| 35 |