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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.