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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
rhiheu
Helper I
Helper I

Custom formatting of x-axis groups for 100% Stacked column charts

Hi,

For my 100% Stacked column chart, I have a group of products grouped by date, along the x-axis. Is there a way I can custom format groups to be different from each other?

A. My first preference would be to alternate the background colour of each group, e.g.

rhiheu_4-1672803097340.png

B. But if that's not possible, if I could atleast bold or colour today's date group that would be great, e.g.

rhiheu_5-1672803149154.png

I've gotten as far as the custom column to change the formatting of today, which works on a table:

 

TodayFormatting = IF(KronosWithBothGroups[date] = TODAY(), "green", "white")

 

rhiheu_3-1672802942126.png

But when I try and apply it in the x-axis > Values formatting, it turns everything green, I'm not sure how to apply the formatting to only one (or some) date groups:

rhiheu_6-1672803380008.png

 

rhiheu_7-1672803397053.png

 

Any help appreciated, thanks.

 

4 REPLIES 4
rhiheu
Helper I
Helper I

Hi @chrisyan_manalu, thanks for your reply. I've added that formula (to a new column called 'TodayInteger') and I can't seem to get it to work to change the background colour to green even on the table:

rhiheu_0-1672807427403.png

 

@rhiheu it's looks like your data type of TodayInteger is text

Please change it to number  

Oops, you're right, sorry about that. I've changed it to number and it now works on the test table (with max, not sure if that's the best option?)

 

rhiheu_0-1672809156248.png

 

However unfortunately it doesn't seem to work on the X-axis > Values formatting of the 100% stacked column chart, it's colouring everything:

rhiheu_1-1672809358524.png

 

chrisyan_manalu
Helper II
Helper II

@rhiheu if you dont mind, you can chage the custom column to integer.

 

TodayFormatting = IF(KronosWithBothGroups[date] = TODAY(), "1", "0")

 

And you can make conditional formating using rule format which if value equals to 1 then green (colour code)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors