Forum Discussion
Conditional formatting by matrix segment
Hi Anonymous ,
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?
- Anonymous4 years agoNot applicable
Hi Anonymous ,
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.- Anonymous4 years agoNot applicable
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?