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

Color condition in the stacked bar graph

hi community,

 

I need to create a graph of stacked bars, with the following color rule: Gray color for days larger than the current date. And for the other days, set a color for each category in the chart. as shown in the image below:

Image 151.jpg

 

it's possible?

 

I got to separate the calculation, but the graph does not support more than one value on the axis.
 
I created the measure that checks the product category, and the current date, but when you add it to the color rule it doesn't work, it changes the color of the entire bar instead of the fraction that corresponds to the category.
 
measure =
IF([category] = "Basic","#51B679",
IF([category] = "Off","#D74552",
IF([category] = "Prem","#F6F6F6",
))))

measureDate = IF ([Date]>= NOW(),"#000",[measure])
 
can you help me?
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , conditional formatting is not possible visual with the legend.

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

If there is no legend, can one put in conditional formatting to show weekends? 
@amitchandak 

nick_SMTC_0-1619211473967.png

 

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.