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.
Hello!
I am creating a bar chart visual for a set of companies and was wondering if is it possible to highlight a particular company (based on selection) in the X axis?
The end goal is to get something similar like below, to highlight one company based on selection.
Regards,
Saket
Solved! Go to Solution.
Hi @Anonymous ,
Create a disconnected table as slicer, and then create a measure to apply to bar chart data color conditional formatting.
Highlight =
var _product = VALUES('Table'[Product])
var selected_pro = MAX(financials[Product])
var _isfiltered = ISFILTERED('Table'[Product])
return IF(_isfiltered,IF(selected_pro in _product,"#594dff","#f0f0f0"))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Create a disconnected table as slicer, and then create a measure to apply to bar chart data color conditional formatting.
Highlight =
var _product = VALUES('Table'[Product])
var selected_pro = MAX(financials[Product])
var _isfiltered = ISFILTERED('Table'[Product])
return IF(_isfiltered,IF(selected_pro in _product,"#594dff","#f0f0f0"))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @V-lianl-msft , thanks for this. It works.
Digging bit deeper here, how would it be possible to do the same if we would add years as legend on the chart?
Thanks again!
Hi @Anonymous ,
You can do something as below:
On the right, in place of a slicer I have used a Table visual and the interactions work as expected.
Make sure that your interactions are set right as follows:
Let me know if this is what you are looking for.
Thanks,
Pragati
@Anonymous you mean when you click the company in the bar chart, it would not change the color but by default, the selected one remains highlighted and the other bar goes bit transparent? You will not able to change the color of the selected one in the bar.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |