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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
Super User
Super User

 

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
Super User
Super User

 

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.