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! Request now

Reply
Anonymous
Not applicable

Add indicators in Bar Chart

I have a bar chart with X-axis in daily buckets and volume on Y -axis. I have a conditonal formatting which says - If my volume is greater than yesterday, color the bar red else Green. I am looking an additonal way to highlight weekends.  I tried to add some kind of icons to the chart but I was not able to do it . What would be a better way to highlight weekends in this case where I already have a conditonal format applied for a different logic?

 

In my data source I have a column to identify day number For e.g. Sunday is 1 and Saturday is 7. Any inputs will be helpful. Thanks in advance. 

 

Sample_Chart.png

Let me know if any further information will help address the query. 

1 ACCEPTED SOLUTION

What colour do you want weekends?

You just need to continue to refine your existing measure, and create four values:

If weekend and greater than previous day, then 1,
If weekend and less than previous day then 2,
If weekday and greater than previous day then 3,
If weekday and less than previous day then 4.

Then conditional format with light green, green, light red, red, or whatever colours you'd like.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , if you are not using legend,

You can create color measure and use it. example

color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

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
Anonymous
Not applicable

Amit,

 

Thanks. A variation in dark and light colours kind of worked out as a solution. 

 

Regards,

GB

AllisonKennedy
Super User
Super User

You could create a measure that will determine if it's a weekend first and apply desired colour, then check for is greater than previous day and apply next colour. If you need help with this exact calculation, please provide column and table names for your existing data and explain how you have done current colour coding (are you already using a measure?)

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Allison,

 

Thanks a lot for your quick response. 

 

I have already created a quick measure which says if my volume today is greater than previous day then 1 else 0. Based on this measure I have applied the below conditional formatting. 

 

gbhat_0-1594888262109.png

Now while the bar colors will be either Green or Red based on above condition I somehow want to highlight weekends to stand out so I can easily identify which bars belong to weekends.  For this as a first step I created a column called Day_Number where Sunday is marked 1 (First day of the week) and Saturday 7 and so on. I tried to do something based on this but I am stuck at this point as I cannot apply multiple conditional formatting on a single quantity. Is there any other way or any other chart options ? 

 

Thanks in advance !

 

What colour do you want weekends?

You just need to continue to refine your existing measure, and create four values:

If weekend and greater than previous day, then 1,
If weekend and less than previous day then 2,
If weekday and greater than previous day then 3,
If weekday and less than previous day then 4.

Then conditional format with light green, green, light red, red, or whatever colours you'd like.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Allison,

 

Thank you . This worked out well as a solution. 

Regards,

GB

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