cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
aulona12
Frequent Visitor

How to apply the same conditional formatting on multiple columns?

Hello all, 

 

Is there a way to apply the same conditional formatting, in this case red colored font for all values that are less then zero, for multiple columns at a time? The method that i am using at the moment is selecting the drop down arrow on every single column, choosing conditional formatting, then font color, then : 

 

aulona12_0-1651086759052.png

There are 50+ columns that need the same conditional formatting as described above and it is taking way too much time. 

 

Thanks in advance for any help. 

 

 

1 ACCEPTED SOLUTION
speedramps
Community Champion
Community Champion

 

Please consider this solution and remember I am an unpaid Power BI volunteer, so click the thumbs up button if you like me helping you and the solved button if I fix your problem.

Click here for an example solution 

 

This example has the targets in table but you could hard code them in a switch statement.
A table is better because the users can edit the targets without a PBI developer changing DAX. 


Create a dax measure like this

KPI Colour =
VAR mytarget = SELECTEDVALUE(Facts[Target])
RETURN
IF(SUM(Facts[Value])> mytarget"Red","Green")
 
Then in conditioinal formating select
Format Style = Field Value

What field should we base this on = KPI Colour

 

 

View solution in original post

3 REPLIES 3
speedramps
Community Champion
Community Champion

 

Please consider this solution and remember I am an unpaid Power BI volunteer, so click the thumbs up button if you like me helping you and the solved button if I fix your problem.

Click here for an example solution 

 

This example has the targets in table but you could hard code them in a switch statement.
A table is better because the users can edit the targets without a PBI developer changing DAX. 


Create a dax measure like this

KPI Colour =
VAR mytarget = SELECTEDVALUE(Facts[Target])
RETURN
IF(SUM(Facts[Value])> mytarget"Red","Green")
 
Then in conditioinal formating select
Format Style = Field Value

What field should we base this on = KPI Colour

 

 

I can not state how much i apreciate your contribution. I wasted hours figuring this out. The docmentation is ok but without an example i could not figure it out. Your example saved me. Chat GPT was worthless also.

Thank you. Glad you aprecaite the effort I put into creating an example solution

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors