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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

conditional formatting rules depending on other value from different column

I am wondering if it is possible to get the rules from background conditional formattting depending on a value from another column.
So as you can see under neath I got these rules for a specific table. When the value is less than 0.85 the colour becomes red and when the value is greater than 0.85 it becomes green. I want this values(0.85) depending on a specific column. I want it to depend on the column 'Doelstelling'. So as you can see the values at 'vertrek niet te laat' are all red, because they are all less than 'doelstelling' 85%, but I want the rule automatically change when the 'doelstelling'becomes another value. So when the 'doelstelling' becomes 75% and the 'vertrek niet te laat' changes remain the same, the rules must automatically change and the values from 'vertrek niet te laat' will change to green without me changing te rules, but the column 'doelstelling' change the rules. Is this possible with any function in PowerBi?Schermafbeelding 2022-03-09 122345.png Schermafbeelding 2022-03-09 122428.png

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can create a new measure which returns a value based on the comparison between the result and the target.

I'm not sure if doelstelling is a column or a measure, but if its a measure then something like

Background colour measure =
var currentValue = CALCULATE( [Vertrek niet te laat] )
var targetValue = CALCULATE( [doestelling] )
return IF( currentValue >= targetValue, 1, -1)

Then in your background formatting function you can set green if the value is 1 or red if it is -1

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

'doelstelling' is not a measure, but I made it a measure and now it works with your code, thank you!

johnt75
Super User
Super User

You can create a new measure which returns a value based on the comparison between the result and the target.

I'm not sure if doelstelling is a column or a measure, but if its a measure then something like

Background colour measure =
var currentValue = CALCULATE( [Vertrek niet te laat] )
var targetValue = CALCULATE( [doestelling] )
return IF( currentValue >= targetValue, 1, -1)

Then in your background formatting function you can set green if the value is 1 or red if it is -1

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.