Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
Can anyone can help?
I have been asked by a client to update the stacked bar chart below such that weekends (and holidays) are highlighted.
As an approach, I was thinking of creating a calculated column with a DAX formula that returned 1 or TRUE for dates that fall on the weekend and then either applying conditional formatting to the X-Axis column labels and changing the colour of those dates which fall on the weeked, or just having a light grey column which takes up 100% of the width and height of the column.
Unfortunately, it seems that it is neither possible to apply conditional formatting to the axis labels nor have a combined value/percentage bar chart in the basic PowerBI visualisations.
I wondered if anyone has a solution to this problem, or knows of a add-in visualisation that has this functionality
Many thanks
Solved! Go to Solution.
Hi @niirusan ,
You can create the following measure
Measure =
var _weekend=WEEKDAY(MAX('Table'[Date]),2)
return
IF(_weekend=6||_weekend=7,"red","blue")
Then put the measure into Data colors and set as follows.
This result is this.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @niirusan ,
You can create the following measure
Measure =
var _weekend=WEEKDAY(MAX('Table'[Date]),2)
return
IF(_weekend=6||_weekend=7,"red","blue")
Then put the measure into Data colors and set as follows.
This result is this.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Just be careful with your assumptions on what a weekend is. Differs by country.
"Unfortunately, it seems that it is neither possible to apply conditional formatting to the axis labels"
Not any more! Yay! That feature was recently added. Update your Power BI Desktop.
I would highly recommend you use an external Calendar table that includes your definition of weekend and holiday. You can also include a color name column right there, and use that for the axis custom formatting.
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
84 | |
66 |