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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
lherbert501
Post Patron
Post Patron

Conditional formatting On/Off switch

Hi,

 

I have my matrix with conditional formatting which works fine, but I would love to be able to give the user the option of turning it on and off to just see the figures without the formatting, where required. 

 

Can this be done without using bookmarks?

 

Thanks

 

Liam

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @lherbert501 ,

 

you can achieve what your are looking for.

 

Create a simple table with two values: On / Off. Use the column as a slicer, I recommend making the slicer a single select slicer.

 

Then create a measure that returns a hexcode like "#ffa500" for orange or what ever you need to create your conditional formatting. Wrapt this measure into a second measure like so:

 

apply conditional formatting =
var on_off = selectedvalue('<tablenameOnOff>{On/Off] , "Off" )
return
if(on_off = "Off" = "On" , [your measure that returns the hexcode] , blank())

 

Use this measure for the conditional formatting, make sure that you select the "Field value" option as the format style and then select the above measure [apply conditional formatting].

 

Hopefully, this provides what you are looking for, to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey @lherbert501 ,

 

you can achieve what your are looking for.

 

Create a simple table with two values: On / Off. Use the column as a slicer, I recommend making the slicer a single select slicer.

 

Then create a measure that returns a hexcode like "#ffa500" for orange or what ever you need to create your conditional formatting. Wrapt this measure into a second measure like so:

 

apply conditional formatting =
var on_off = selectedvalue('<tablenameOnOff>{On/Off] , "Off" )
return
if(on_off = "Off" = "On" , [your measure that returns the hexcode] , blank())

 

Use this measure for the conditional formatting, make sure that you select the "Field value" option as the format style and then select the above measure [apply conditional formatting].

 

Hopefully, this provides what you are looking for, to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @TomMartens 

 

Thanks for this. If my formatting was 4 ways like below, could this still be applied?

 

Thanks

 

Liam

 

lherbert501_0-1699268355122.png

 

Hey @lherbert501 ,

 

sure, you can either use a nested IF or switch in the branch that returns one of the four shades of red.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thankyou Sir @TomMartens

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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