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

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.

Reply
Anonymous
Not applicable

Highlight a value (for eg company name) in X axis in bar chart

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.

 

Bar chart.PNG

 

Regards,
Saket

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

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"))

 

V-lianl-msft_1-1610530197130.pngV-lianl-msft_2-1610530227587.pngV-lianl-msft_3-1610530239647.png

 

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

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"))

 

V-lianl-msft_1-1610530197130.pngV-lianl-msft_2-1610530227587.pngV-lianl-msft_3-1610530239647.png

 

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

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!

Pragati11
Super User
Super User

Hi @Anonymous ,

 

You can do something as below:

interaction.gif

 

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:

Pragati11_0-1610386947157.png

 

Let me know if this is what you are looking for.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

parry2k
Super User
Super User

@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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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