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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mdm2025
Frequent Visitor

Conditional Formatting Based on Measure using Slicer Selection Without Visual Interaction

Hello everyone,

 

I'm facing a challenge with setting up conditional formatting in a Power BI visual using a calculated measure. I’ve created a measure and applied it in the Field value section of the Data colors menu. It works correctly for two conditions:

  • Highest value → Black
  • Specific value (e.g., "X value " from 'All available Data'[Provider]) → Orange
    mdm2025_1-1748619251946.png

Now, I want to add a third condition:

  • If a provider is selected in a slicer, that provider’s column in the visual should be colored purple.

Here’s the setup:

  • The slicer uses 'Provider Table'[Provider].
  • The visual uses 'All available Data'[Provider].
  • There is an active relationship between the two tables on the Provider column.
  • I have disabled visual interaction between the slicer and the visual, so the chart always shows all providers regardless of slicer selection.
  • The slicer is intended to act as a menu, allowing the user to highlight a specific provider in purple — without filtering the visual.
  • Here is my DAX measure
    mdm2025_2-1748619329440.png

However, the condition comparing SELECTEDVALUE('All available Data'[Provider]) to SELECTEDVALUE('Provider Table'[Provider]) does not seem to trigger the purple color as expected.
If I enable interactions on the slicer I am getting purple color only if one value is selected. If all or more I am getting same result as without having interactions enabled. 

Has anyone successfully implemented this kind of logic? Any ideas on how to reference the slicer selection in a measure used for conditional formatting when the slicer does not filter the visual?

Thanks in advance!

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Click here to download a solution from Onedrive

Click here 

 

How it works ...

 

Create a detached picklist table

speedramps_0-1748631688725.png

Create a measure

RAG = 
var mypicks = VALUES(picklist[Customers])
var mygraph = SELECTEDVALUE(yourdata[Customers])
RETURN
IF(mygraph in mypicks, "Red")

 

Add conditional formating to the column

speedramps_1-1748631795595.png

 

Please click the thunbs up and the [accept solution button].

Many thanks! 

View solution in original post

6 REPLIES 6
speedramps
Super User
Super User

Hi again MDM

 

Glad that the problem has been solved.

 

Hope you learned something new about detached picklist and Dax.

 

Thanks, speedramps 

mdm2025
Frequent Visitor

Hi @speedramps ,

Thank you very much for providing the solution along with the example. 
However after replicating the setup the conditional formating measure lists all values as red instead of only the selected one. I have tried disabling/enabling the interaction of the slicer with the visual but the color is the same for all selections (red). 

mdm2025_0-1748866680390.png

I have tried making an active relationship betwen the tables and inactivating it with the same result. 
To elaborate my setup is the same as in your example:
The visual holds the dataset values 
The slicer holds the picklist table. 

mdm2025_1-1748866720833.png

 

Any ideeas on what to double check? 

Thanks again!

Hi again MDM

 

Sorry you are still having problems

 

Please click on the Onedrive link in my original answer. Check it works ok. 

 

Once you proved to yourself that the solution works, then repeat my instructions more carefully.

 

Don't make changes (eg uses relationships).

 

Focus yourself on copying the instructions exactly. It will work.

Hi @speedramps ,

 

You are correct. Thank you againg for following up.

Not sure what I have changed but it works now 😄.

I have also update the DAX formula with additional conditions among which is having the blue default if no values from the slicer is selected( in case heplful for other community members in the future). 

mdm2025_0-1748869256030.png


All the best!


v-tejrama
Community Support
Community Support

Hi @mdm2025,

Has your issue been resolved?If the response provided by @speedramps  addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.

Thank you for your understanding!

speedramps
Super User
Super User

Click here to download a solution from Onedrive

Click here 

 

How it works ...

 

Create a detached picklist table

speedramps_0-1748631688725.png

Create a measure

RAG = 
var mypicks = VALUES(picklist[Customers])
var mygraph = SELECTEDVALUE(yourdata[Customers])
RETURN
IF(mygraph in mypicks, "Red")

 

Add conditional formating to the column

speedramps_1-1748631795595.png

 

Please click the thunbs up and the [accept solution button].

Many thanks! 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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