Showing results for 
Search instead for 
Did you mean: 
akj2784 Member

Position based coloring of the bar in power BI

Hi All,


I have a requirement where user can select any 3 products from the slicer, and the bar/line combo chart should show the bar for each products in different color. 

Is there any way to do it ? If I had code the color to a particular product, it may not work when user selects some other product.

Basically I am looking for Position based color coding of the bar. 1st position red, 2nd position black, 3rd position blue, something like this.




v-jiascu-msft Super Contributor
Super Contributor

Re: Position based coloring of the bar in power BI

Hi @akj2784,


There are two workarounds you can try.

1. Assign a color for each product. 



2. Add the same column of Axis to the legend.




Best Regards,


Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
akj2784 Member

Re: Position based coloring of the bar in power BI

Thanks Dale.

Problem with this approach is if we have thousands of Product, we cannot set colors for all.

And also line and Clustered Column chart does not have legend featue. Is there any other alternative ?


Helpful resources

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 332 members 2,486 guests
Please welcome our newest community members: