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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Luuud8080
New Member

Conditional formatting per row in a table

Hello everybody,

Hope you can maybe help me. I need to create a table with conditional formatting but rules per row can be different, i create this one as an example ot be clear.
Ex. There are categories where positive values are better (Exporta, produciotn, etc) , so bigger they are, greener they will be, lower > dark red

Some other, instead are better when they decrease so green should be for negative values and red if they grow (interest rates, unemployment, etc).

I created a measure for MoM%, but these way it's not possible to format row as I explained above.

Someone has some idea how to proceed?

Thank you very much in advance

 

Table.PNG

 

1 ACCEPTED SOLUTION
SamWiseOwl
Super User
Super User

Hi @Luuud8080 

When applying conditional formatting you can choose from: Gradient, Rules or Field Value.

The final option lets you use a measure as a formatter.

Right click your table and choose create measure.

Then create a measure using switch which lets you do multiple tests.

 

Colour measure =
Switch(
True()
,SelectedValue(table[column]) = "Industrial Production YoY" && [Measure] >= 0.5

,"Green" --If both conditions apply return green

,SelectedValue(table[column]) = "Industrial Production YoY" && [Measure] <0.5

,"Red" --If both conditions apply return red

,SelectedValue(table[column]) = "Jobless" && [Measure] <= 0.5

,"Green" --If both conditions apply return green

,SelectedValue(table[column]) = "Jobless" && [Measure] <= 0.5

,"Red" --If both conditions apply return green

)

 

Add as many rows as required, testing the current row and applying different conditions.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

1 REPLY 1
SamWiseOwl
Super User
Super User

Hi @Luuud8080 

When applying conditional formatting you can choose from: Gradient, Rules or Field Value.

The final option lets you use a measure as a formatter.

Right click your table and choose create measure.

Then create a measure using switch which lets you do multiple tests.

 

Colour measure =
Switch(
True()
,SelectedValue(table[column]) = "Industrial Production YoY" && [Measure] >= 0.5

,"Green" --If both conditions apply return green

,SelectedValue(table[column]) = "Industrial Production YoY" && [Measure] <0.5

,"Red" --If both conditions apply return red

,SelectedValue(table[column]) = "Jobless" && [Measure] <= 0.5

,"Green" --If both conditions apply return green

,SelectedValue(table[column]) = "Jobless" && [Measure] <= 0.5

,"Red" --If both conditions apply return green

)

 

Add as many rows as required, testing the current row and applying different conditions.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.