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
RVIG
Regular Visitor

Conditional Formatting within Maxtrix visual

Hello everyone,

 

I'm using BI to monitor data from a large amount of CSV files which contains data from an endurance test.

This endurance test repeat a cycle containing 2 phases where I'm monitoring the engine speed.
I have the following matrix visual where I plot the cycles name on the rows, the Phase on the columns and the average of the speed as Values.

To help analyse the data, I want to add a conditional formatting on the Average Speed. I mean, if the speed average is between 12000 +/- 50rpm on phase 1 and 9200 +/-50 rpm on phase 2, I want to highlight in green the values.

RVIG_0-1726494141403.png

 

As Average of Speed is a unique column, I can only set one rule to format my data.

If anyone has an idea, it would be very helfull.

 

Thanks in advance for your time and support

 

RVIG

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @RVIG -First, you need to create a measure that will evaluate whether the average speed falls within the specified ranges for each phase. 

 

Speed Formatting =
VAR AvgSpeed = AVERAGE('YourTable'[Speed])
VAR Phase = SELECTEDVALUE('YourTable'[Phase])
RETURN
IF(
(Phase = "Phase 1" && (AvgSpeed >= 11950 && AvgSpeed <= 12050)) ||
(Phase = "Phase 2" && (AvgSpeed >= 9150 && AvgSpeed <= 9250)),
1, // This value will be used to apply the formatting
0 // This value will not apply formatting
)

rajendraongole1_1-1726496320698.png

 

 

above measure helps in creating the conditional formatting 

go to format pane, cellelement

rajendraongole1_0-1726496203097.png

Set up a rule to apply formatting based on the value of the Speed Formatting measure.
If value: is
Value: 1
Color: Choose green or the color you want to use for highlighting.

 

rajendraongole1_2-1726496390588.png

Hope this works to highlight the background of speed.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @RVIG -First, you need to create a measure that will evaluate whether the average speed falls within the specified ranges for each phase. 

 

Speed Formatting =
VAR AvgSpeed = AVERAGE('YourTable'[Speed])
VAR Phase = SELECTEDVALUE('YourTable'[Phase])
RETURN
IF(
(Phase = "Phase 1" && (AvgSpeed >= 11950 && AvgSpeed <= 12050)) ||
(Phase = "Phase 2" && (AvgSpeed >= 9150 && AvgSpeed <= 9250)),
1, // This value will be used to apply the formatting
0 // This value will not apply formatting
)

rajendraongole1_1-1726496320698.png

 

 

above measure helps in creating the conditional formatting 

go to format pane, cellelement

rajendraongole1_0-1726496203097.png

Set up a rule to apply formatting based on the value of the Speed Formatting measure.
If value: is
Value: 1
Color: Choose green or the color you want to use for highlighting.

 

rajendraongole1_2-1726496390588.png

Hope this works to highlight the background of speed.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1,

 

This works perfectly. I managed to apply it to my case.

Thanks a lot for your quick answer and support

 

RVIG

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