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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
PBIUser2024
Frequent Visitor

Dynamic Colours in grouped Bar Chart

Hi,

 

i do have a grouped bar chart with many bars, which will still grow:

PBIUser2024_0-1712827245322.png

 

By Slicer, only 2 of these bars will be shown for the user, he will be able to switch between them:

PBIUser2024_1-1712827303161.png

The problem is, that every Bar has its own colour, so by switching it they will always change. I am working with a custom colour palette, but I have reached a point the colours don't fit to the scheme anymore. Is there a way to give the 2 bars always the same colour? This visual does not have the option to have conditional colours (fx), is there a alternativ visual to try?

 

Cheers

2 REPLIES 2
Anonymous
Not applicable

Hi @PBIUser2024 ,

Based on the information you have provided, I have created a sample data for you, which you can follow at the yellow mark to transform the colour of the column to the same:

Sample data:

vyifanwmsft_1-1712889981261.png

Change the colour:

vyifanwmsft_4-1712890230796.png

vyifanwmsft_3-1712890194755.png

 

Final output:

vyifanwmsft_2-1712890054716.png

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

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

Thank you for your reply @Anonymous . Unfortunately, the visual needs to be much more dynamic, there will be a lot of ID's and they will grow, it is not an Option to change the colour everytime manually. 

PBIUser2024_0-1712903644515.png

 

The visual always shows 2 ID's, based on the 2 Slicer. I want the left and right bar to always have the same colors, e.g. left always red, right always blue. Regardless of the IDs selected. I have reworked and added to your example: 

2 new tables which only have the distinct 'ID' of 'Table' (DimID1 and DimID2). Each Slicer uses one of the tables.

a new Measure: 

Or Filter =
IF (
    SELECTEDVALUE ( 'Table'[ID] )
        IN UNION ( ALLSELECTED ( DimID1[ID]), ALLSELECTED ( DimID2[ID] ) ),
    "Y",
    "N"
)
This Measure is used as a filter on the bar char, filtering on ='Y'. 
 
Cheers

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.