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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Changing bar colour based on a Bar graph

Hi!

 

Is it possinle to chnage the colour of the bars in a bar chart based on a condition where keep all the bars for example blue if its before current month and red if its after current months. Say I have a chart with dates in x axis and sales amount on the y axis an I want to show all the sales until June in Blue bars and and July on wards in Red , is it possible yo do so?

 

Thanks,

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

As I know, if you want to use conditional  formatting on bar color, you can't  add field in Legend. You could refer to my sample for details.

754.PNG

Best Regards,
Zoe Zhi

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

9 REPLIES 9
dax
Community Support
Community Support

Hi @Anonymous , 

As I know, if you want to use conditional  formatting on bar color, you can't  add field in Legend. You could refer to my sample for details.

754.PNG

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

Great , can we do this same for clustured bar chart with multiple bars on it, because that is the problem I am facing now, I dont see the option for formating color when I have 2 bars(2 columns on Column value section)?

dax
Community Support
Community Support

Hi @Anonymous , 

I don't see Column value in clustured bar chart, if possible, could you please inform me more detailed information(such as your simple sample data and your chart setting)?

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

Hi,

 

Step 1 : Create a measure with DAX as below:

Current Month = MONTH(TODAY())

 

Step 2 : Create a column for finding month from the date your have:

Month of shipdate = MONTH(Orders[Ship Date].[Date])
 
Step3 : Create another measure with DAX as below:
Previous Or Future = IF(Orders[Month of shipdate]<[Current Month],"Previous","Future")
 
Drop this "Previous Or Future" to Legends of your Bar chart.
 

 

Anonymous
Not applicable

Step 3 it does not allow me to make the meassure with that option.

Anonymous
Not applicable

Sorry not step 3 , thats fine, but the issue is cannot add it to the legend.

Anonymous
Not applicable

Sorry, Its suppose to be a New Column and not New Measure as this is categorical in nature.

 

Hope this solves your issue.

Anonymous
Not applicable

I created both meassure and cloum but the issue is I am unable to add it to the legend on my clustered bar chart.

Anonymous
Not applicable

Please provide a sample workbook to work on as i'm able to do with my data set.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.