Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RLSid17
Helper III
Helper III

Conditional Formatting Matrix Row

Hi,

I have a query relating to conditional formatting by row I have a screenshot here:

RLSid17_0-1666677685523.png


So the Unfavorable, Neutral, and Favorable are just 1 column (I used the count and then show value as a percentage of grand total.)

Naturally when the Favorable hits higher it shows as green but how do I make the Unfavorable responses to be red when it is higher? Since all 3 are just 1 column as shown in the conditional formatting:

RLSid17_1-1666677890917.png

Any help or solution would be appreciated! Kindly let me know if there are other details needed to achieve a solution.

4 REPLIES 4
RLSid17
Helper III
Helper III

Thank you so much! This is much appreciated. I will try this later on and will let you know the results. 🙂  

Anonymous
Not applicable

Hi @RLSid17 ,

I have created a simple sample, please refer to it to see if it helps you.

vpollymsft_0-1666749081123.png

 

Create 2 measures.

 

 

Measure =
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[result] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
                && 'Table'[result] = SELECTEDVALUE ( 'Table'[result] )
        )
    )
VAR _countsubject =
    CALCULATE (
        COUNT ( 'Table'[subject] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
        )
    )
VAR _percent = _count / _countsubject
VAR _maxvalu =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
        ),
        _percent
    )
RETURN
    _percent
Measure2 =
VAR _1 =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
        ),
        [Measure]
    )
VAR _2 =
    IF (
        [Measure] = _1
            && MAX ( 'Table'[result] ) = "Unfavorable",
        "Red",
        IF (
            [Measure] = _1
                && MAX ( 'Table'[result] ) = "Favorable",
            "Green",
            IF ( [Measure] = _1 && MAX ( 'Table'[result] ) = "Neutral", "Orange", BLANK () )
        )
    )
RETURN
    _2

 

 

 

vpollymsft_2-1666749548716.png

 

vpollymsft_1-1666749529259.png

If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output with more details.

 

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 @Anonymous 

Sorry for the late response, I transformed my data and tried the second measure you provided and this was the result:

RLSid17_0-1667143976502.png

This almost works but is there a way for it to format the other columns (Neutral and Unfavorable? For some reason, it is only formatting the Favorable responses. Or rather, only the 1st column is picking up the formatting.

I'm using a Matrix for this to count each responses by column as seen above screenschot.

Hi @Anonymous 

I have tried your solution, I think the color works but it is not the count of responses is not totaling to 100% similar to this where I count the 1 column and show value as a percentage of grand total (I used a matrix visual):

RLSid17_0-1666856125714.png


I have a workaround where I only change the color where the lower the value is the lighter the color and the higher the value the darker it gets:

RLSid17_1-1666856180707.png

 







Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors