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
Anonymous
Not applicable

Conditional Formatting - Font Color should be changed based on Values in comparison with Total

Hi Communtity, 

 

I have a requirement to add a conditional formatting for one of Cross tabs Column . The font color of the below shown column should changes as per the rules .

 

  • Red = Percentage < 90%
  • Green = Percentage is >=90% and >=Overall %
  • Gold = Percentage is >= 90% and <Overall %

Overall in nothing but the Total % at the bottom of the screenshot . We need to compare each and every value that we have in rows with Overall and then assign a color . 

Capture.JPG

 

Please assist if there is a way to acheive the same. 

 

Thanks,

G Venkatesh

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Assume you have a % column ( and it is between 0 to 1, marked as % to display 0 to 100)

 

Measure =

var _1 = [Percentage]

var _2 = calculate([Percentage], allselected())

return

Switch(True() ,

_1 < .9 , "Red" ,

_1 >.9 && _1>= _2 , "Green" ,

_1 >.9 && _1< _2 , "Gold"

)

 

Use this in conditional formatting using the field value option

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Assume you have a % column ( and it is between 0 to 1, marked as % to display 0 to 100)

 

Measure =

var _1 = [Percentage]

var _2 = calculate([Percentage], allselected())

return

Switch(True() ,

_1 < .9 , "Red" ,

_1 >.9 && _1>= _2 , "Green" ,

_1 >.9 && _1< _2 , "Gold"

)

 

Use this in conditional formatting using the field value option

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Anonymous
Not applicable

Thanks @amitchandak  , This helped to resolve the issue . 

 

G Venkatesh

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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