Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I want to customize column colors based on date field. I use stacked column chart in my project, in shared axis there are 2 different field (date and job names). For column values, I try to change colors of columns according to date, i.e. for future I want to see column color as red, for past I want to get column color as green. Below figure is just an example.
Thank you for your help.
Solved! Go to Solution.
Hi @denemee123
The stacked column chart doesn't let you set the column colors in this way. You can only choose set colors for each category.
regards
Phil
Proud to be a Super User!
Hi @denemee123
Download example PBIX file with charts etc shown below
If you want to set the column colors based on whether they are in the past or future, then you don't want to see each category in a different color?
In which case you can use a Clustered Column or a Stacked Column, plot the data for all categories in one column, per year, and use a Conditional Formatting rule to set the column colors accordingly.
Write a measure like this
Column Color = IF(MAX('DataTable'[Date]) < TODAY(), "#0F0", "#F00")
Format the visual : select fx to create a Conditional Formatting rule
Here is the rule
Giving this
Note 1 I when I took this screenshot I had red dates in the past, green for the future. You want it the other way around. The measure (above) to set the color does it as you want. It's easy to change. Red is "#F00", green is "#0F0"
Note 2 this is a Line & Stacked Column chart and it's only plotting the Sum of value on the y-axis.
Regards
Phil
Proud to be a Super User!
Hi! Try to go to Visual - Columns - Colors and then each category should have a color to assign to.
Hi @denemee123
Download example PBIX file with charts etc shown below
If you want to set the column colors based on whether they are in the past or future, then you don't want to see each category in a different color?
In which case you can use a Clustered Column or a Stacked Column, plot the data for all categories in one column, per year, and use a Conditional Formatting rule to set the column colors accordingly.
Write a measure like this
Column Color = IF(MAX('DataTable'[Date]) < TODAY(), "#0F0", "#F00")
Format the visual : select fx to create a Conditional Formatting rule
Here is the rule
Giving this
Note 1 I when I took this screenshot I had red dates in the past, green for the future. You want it the other way around. The measure (above) to set the color does it as you want. It's easy to change. Red is "#F00", green is "#0F0"
Note 2 this is a Line & Stacked Column chart and it's only plotting the Sum of value on the y-axis.
Regards
Phil
Proud to be a Super User!
Thank you for yor effort 🙂 I got it.
Hi @denemee123
The stacked column chart doesn't let you set the column colors in this way. You can only choose set colors for each category.
regards
Phil
Proud to be a Super User!
Hi @PhilipTreacy ,
Thank you for your reply. Well, is there any visual to apply what I want in PowerBI?
User | Count |
---|---|
97 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
58 |