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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
paul_jones
Frequent Visitor

Conditional Formatting with multiple conditions

I have the matrix below, basically:

 

Device        Error Message         Attempts           Errors           Percentage

Blue1          Did not start                100                   50                    50%

Red1           Interrupted                  150                   50                    33%

 

I created a table of error messages and the color they should be based on percentage.

 

Error Message                         YELLOW               RED

Did not start                                 25%                 50%

Interrupted                                   20%                 30%

 

How can I conditionally format the Percentage column in the matrix based off the values in the reference table?

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
MohammadLoran25
Solution Sage
Solution Sage

Hi @paul_jones ,

The best way for conditional color is:

 

ConditionalColor =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table'[Error Message] ) = "Did not start"
        && SELECTEDVALUE ( 'Table'[Percentage] ) = 0.5, "#HexColorcode",
    SELECTEDVALUE ( 'Table'[Error Message] ) = "Interrupted"
        && SELECTEDVALUE ( 'Table'[Percentage] ) = 0.3, "#HexColorcode"
)

 

If you want to use your second table,you can use CROSSJOIN as well.

But I did not get the logic. This table is a range?

 

Btw, Measure above would solve your problem.

It helped? Mark it as an accepted solution.
Regards,
Loran

 

 

View solution in original post

5 REPLIES 5
paul_jones
Frequent Visitor

I will give that a try.  Thank you.

MohammadLoran25
Solution Sage
Solution Sage

Hi @paul_jones ,

The best way for conditional color is:

 

ConditionalColor =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table'[Error Message] ) = "Did not start"
        && SELECTEDVALUE ( 'Table'[Percentage] ) = 0.5, "#HexColorcode",
    SELECTEDVALUE ( 'Table'[Error Message] ) = "Interrupted"
        && SELECTEDVALUE ( 'Table'[Percentage] ) = 0.3, "#HexColorcode"
)

 

If you want to use your second table,you can use CROSSJOIN as well.

But I did not get the logic. This table is a range?

 

Btw, Measure above would solve your problem.

It helped? Mark it as an accepted solution.
Regards,
Loran

 

 

Forgive me, I'm a novice, but where do I use this?

Hi,

 

you can create an measure. If you do so there will Open a bar at the top of your Report. Now you can Type in the Code.

 

Best

I wasn't clear.  I know how to create a measure.  I just didn't know how to apply it to conditional formatting.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors