Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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).
In this one, the selected company (on the left) returns all companies on the right, without highlighting the selected company.
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!
Solved! Go to Solution.
Thanks! I think I found the solution.
This was as active, but needed to be 'inactive':
Hi @vbthomass ,
Thanks for the feedback, the solution you provided is valuable.
Best regards,
Adamk Kong
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!
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:
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:
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':
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
8 | |
6 |