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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anshenterprices
Helper IV
Helper IV

Cant change the colour on bars when i use axis, Legend and values at the same time

Hello,

Cant change the colour on bars(Clustered column chart) when i use axis, Legend and values at the same time

Source data

CollegeNameClassnoofstudents
ABCFY60
ABCSY80
ABCTY50
XYZst40
XYZnd70
XYZrd30

 

I have added clusterd column char on page and use class as axis , college name as legend and values as noofstudents

i want to change colour of bars when nofostudents greater than 60 then it should be green bar, and less than 60 it should be red bar.

Thanks

1 ACCEPTED SOLUTION

Hi, @Anshenterprices 

Remove the field from the legend, then create a measure for the color rule like below

 

_Color =
SWITCH (
    TRUE (),
    MAX ( 'Table'[noofstudents] ) > 60, "Green",
    MAX ( 'Table'[noofstudents] ) < 60, "Red"
)

 

Apply the above measure to the data color of the format field

v-angzheng-msft_0-1623136328819.png

Please refer to the attachment below for details

 

For reference:

https://community.powerbi.com/t5/Desktop/Changing-bar-colour-based-on-a-Bar-graph/m-p/1153281

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
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-angzheng-msft
Community Support
Community Support

Hi, @Anshenterprices 

Can you please elaborate on what you are trying to achieve?

If you want to change the color of the table bar, just to change the bar color in the Format field

 

v-angzheng-msft_0-1623121680782.png

 

Hope this helps

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

Cant change the colour on bars(Clustered column chart) when i use axis, Legend and values at the same time

Source data

CollegeNameClassnoofstudents
ABCFY60
ABCSY80
ABCTY50
XYZst40
XYZnd70
XYZrd30

 

I have added clusterd column char on page and use class as axis , college name as legend and values as noofstudents

i want to change colour of bars when nofostudents greater than 60 then it should be green bar, and less than 60 it should be red bar.

Thanks

Hi, @Anshenterprices 

Remove the field from the legend, then create a measure for the color rule like below

 

_Color =
SWITCH (
    TRUE (),
    MAX ( 'Table'[noofstudents] ) > 60, "Green",
    MAX ( 'Table'[noofstudents] ) < 60, "Red"
)

 

Apply the above measure to the data color of the format field

v-angzheng-msft_0-1623136328819.png

Please refer to the attachment below for details

 

For reference:

https://community.powerbi.com/t5/Desktop/Changing-bar-colour-based-on-a-Bar-graph/m-p/1153281

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anshenterprices , Conditional formatting is not supported with legends as of now.

 

You can log a new idea or vote for an existing one. https://ideas.powerbi.com/ideas/

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors