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
vbthomass
Regular Visitor

Conditional formatting highlighting selected value in slicer

I would like to use conditional formatting to highlight a specific bar in my bar chart, based on the value I have selected in my slicer. All over the internet, I find the same DAX formula which is the following:

 

 HighlightCompany =
IF(
SELECTEDVALUE(Company[CompanyName]) = MAX(Company[CompanyName]),
1, // This means the company is selected, and it will be highlighted
0 // This means the company is not selected
)

 

Although, when I do this DAX formula, all bars are highlighted. I thought it might've been because my slicer is not filtering the bar chart, although when I choose to filter the bar chart, it only shows the selected company in the bar chart, without all the other companies. Here are some pictures: 

 

In this one, the selected company (on the left) only returns that company in the bar chart (on the right).

vbthomass_0-1734885151844.png

In this one, the selected company (on the left) returns all companies on the right, without highlighting the selected company.

vbthomass_1-1734885175638.png

 

When I use a dax formula, either one of both pops up, and not a combination of both. Does anyone have the same issue or have a solution for this problem? Thank you in advance! 

 

1 ACCEPTED SOLUTION

Thanks! I think I found the solution. 

This was as active, but needed to be 'inactive': 

vbthomass_0-1734985631370.png

 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @vbthomass ,

 

Thanks for the feedback, the solution you provided is valuable.

 

Best regards,

Adamk Kong

lbendlin
Super User
Super User

Should work. Make sure your slicer is fed from a disconnected table.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi

Thank you for getting back with me. It does not seem to work when the table is by itself as well (I made a single table with the competitor names as well). Here is the link to the dummy report: https://we.tl/t-DkLKoSzetb


So what I would like is to have the company selected in the slicer on the left, to be either white or black on the right bar chart (I don't really care about the color at this point). 

Thank you in advance!

You had disabled visual interactions.

 

lbendlin_0-1734909645620.png

 

Hi! 

Thank you for getting back with me. That's what I thought as well, but in your report, it doesn't delete all the other companies. In my report it does (first picture of the original post). I feel it has something to do with the settings of the slicer, although I can't seem to figure out what it is. If this is not what you mean with 'you had disabled visual interaction', could you please specify where I can find this?

This is what I get when I enable visual interaction: 

vbthomass_1-1734976738541.png

 



You also seem to have the second option, which I think could be the issue. Any idea how I can add this option to my report:

vbthomass_0-1734976606311.png

 

Thanks in advance already!

Please check my proposed solution again. The tables need to be disconnected.

Thanks! I think I found the solution. 

This was as active, but needed to be 'inactive': 

vbthomass_0-1734985631370.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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