cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Change Bar Chart Colour based on slicer selection

Hi Experts

 

This should be easy but, as the measures are written in SSAS. How could i as a work around change the bar chart colour based on what selection is made on a particular slicer - field selected...

 

So if i select:

1. banana - bar chart change to Yellow

2. orange - bar chart changes to Orange etc.....

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Change Bar Chart Colour based on slicer selection

@Route11

 

I know how to get 3 different colors for 3 different categories but nor more than that Smiley Sad

 

Basically you can use the Color Saturation Property of the Chart to define colors. Sample PBIX File is attached

 

200w_d

 

 

Try my new Power BI game Cross the River

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Change Bar Chart Colour based on slicer selection

@Route11

 

I know how to get 3 different colors for 3 different categories but nor more than that Smiley Sad

 

Basically you can use the Color Saturation Property of the Chart to define colors. Sample PBIX File is attached

 

200w_d

 

 

Try my new Power BI game Cross the River

View solution in original post

Highlighted
Post Prodigy
Post Prodigy

Re: Change Bar Chart Colour based on slicer selection

Thanks Zubair

Highlighted
Frequent Visitor

Re: Change Bar Chart Colour based on slicer selection

Hello,

 

Alternatively, if the slicer is based on a table, you could add the hex codes of the colors you want to the table. Then set the data colors > Default color format to the column. This avoids the limit of 3 like the previous solution but does come with its own caveat. You can only have one slicer option chosen at a time.


tableSetup.png

 

Setting the Data Colors > Default Color to the HexcodeSetting the Data Colors > Default Color to the Hexcode

Highlighted
Helper I
Helper I

Re: Change Bar Chart Colour based on slicer selection

Hey, thanks for this input.  Where did you find this panel to input choices for default colour?  I couldn't find it anywhere.  Also, do you know if this also works for line graphs?

Highlighted
Frequent Visitor

Re: Change Bar Chart Colour based on slicer selection

This is based off of a relatively new feature of conditional formatting they rolled out for charts. At this time, I have not found it to work for line charts.

 

If you hover over the title of the "Default Color" section of the "Data Colors" title, there should be a set of three dots to the right of the title that open up the conditional menu (see below screenshot). They only show up if you hover over the title so kind of hidden. I hope they make it more prominent in the future. Hope this helps.

Capture.PNG

Highlighted
Advocate III
Advocate III

Re: Change Bar Chart Colour based on slicer selection

I love this tip, @BlueTeam1 . I noticed, though, that the setup doesn't work for the background color of the slicer that holds the values responsible for the color change. Bit of a bummer, but not the end of the world. Thanks for this!

Helpful resources

Announcements
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors