Forum Discussion
Conditional Formatting for Color in Bar Chart
Anonymous
You can create a measure which will indicate which network is selected and in this measure you can assign colors for each network:
Selected Network =
VAR __selectedNetwork = SELECTEDVALUE('Table'[Network])
RETURN
SWITCH(__selectedNetwork,
"Network A", "Red",
"Network B", "Blue",
"Network C", "Yellow"
)
and then in the settings of bar chart you can use this measure as a data colors:
The result:
| Proud to be a Super User. If I helped, please accept the solution and give kudos! |
Hi lkalawski ,
This looks really good. But what I want is to have the bar chart for the [Product] field. So there will be 7 bars with 3 different colors (e.g. Pencil, Book, Pen in red color).
- lkalawski5 years agoResident Rockstar
Hi Anonymous
So, my solution will also work. You only have to change the Axis value in the chart: instead of Network please use Product. Conditional formatting should be as previous.
Proud to be a Super User.
If I helped, please accept the solution and give kudos!
Linkedin- Anonymous5 years agoNot applicable
Hi lkalawski ,
I tried to use this measure but it didn't work. The only things that worked is when you put else statement. I tried to check on my data value and changed it to text type but still didn't work.