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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rpinxt
Solution Sage
Solution Sage

Give different colors to a column based on value of field

I have this column chart :

rpinxt_0-1711637345921.png

So there are 2 fields on the x-axis, being period and 'Type'. At this moment I have 2 types. Actual and LBE1.

As you see they both are blue but I would like to give the type LBE1 a different colour.

Looking into the formating I see every column LBE1.

When I change the color for 1 of them only 1 column LBE1 changes colour.....not all.

 

So I thought ok I have to change them all....bummer....so then I selected another LBE1 and....already that same colour that I set.

Seems all LBE1 columns when I select them have the other color (green) but in the visual only 1 column becomes green....

 

Anybody know what is going on? Or how I should do this properly?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rpinxt ,

 

According to your statement, you want to show conditional format by Type column.

As far as I know, add Type in Legend is a workaround to achieve your goal. Power BI will show color based on the Legend group.

vrzhoumsft_0-1711693499293.png

You can try to use this measure in fx function.

Column Color by Type =
IF ( MAX ( 'Table'[Type] ) = "LBE1", "Green", "Blue" )

However if you add the Country in Legend, the visual will show color based on the country and fx function will be disabled.

Power BI doesn't support us to show color by two different logics.

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
rpinxt
Solution Sage
Solution Sage

Ok I did put field type now in the legend and that does it.

But.....maybe in future we would want to put country in the legend (and make stacked column)

Then type has to go back in x-axis.....can it still be done then?

Anonymous
Not applicable

Hi @rpinxt ,

 

According to your statement, you want to show conditional format by Type column.

As far as I know, add Type in Legend is a workaround to achieve your goal. Power BI will show color based on the Legend group.

vrzhoumsft_0-1711693499293.png

You can try to use this measure in fx function.

Column Color by Type =
IF ( MAX ( 'Table'[Type] ) = "LBE1", "Green", "Blue" )

However if you add the Country in Legend, the visual will show color based on the country and fx function will be disabled.

Power BI doesn't support us to show color by two different logics.

 

Best Regards,
Rico Zhou

 

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

 

Ok thanks @Anonymous .

Using the fx I indeed could have done to.

 

But if we would put country in then I still would need to go to what I done now and put type on the x-axis to make the split.

Without country I also can use the fx thanks.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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