Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Guys,
I have multiple columns which need to be colour coded based on the text present in them. For example, if the letter "G" is present in cells, I need the cell to be "Green"; "A" is "Amber" and so on.
I have 6 letters corresponding to colours like these spread over 9 columns. How do I do this? I need to visualise this in a "Table"
Please help. I have attached a screenshot of it.
Solved! Go to Solution.
Hi, @Anonymous
You can try the following method to write a measure about the color for each column. This is shown below.
Measure1 = Switch(True(),
SELECTEDVALUE('Table'[BCP])="G","Green",
SELECTEDVALUE('Table'[BCP])="A","Amber",
SELECTEDVALUE('Table'[BCP])="N","Red",
SELECTEDVALUE('Table'[BCP])="W","White")
Measure2 = Switch(True(),
SELECTEDVALUE('Table'[DR])="G","Green",
SELECTEDVALUE('Table'[DR])="A","Yellow",
SELECTEDVALUE('Table'[DR])="N","Red",
SELECTEDVALUE('Table'[DR])="W","White")
Measure3 = Switch(True(),
SELECTEDVALUE('Table'[IWsuraWce])="G","Green",
SELECTEDVALUE('Table'[IWsuraWce])="A","Yellow",
SELECTEDVALUE('Table'[IWsuraWce])="N","Red",
SELECTEDVALUE('Table'[IWsuraWce])="W","White")
Then add conditional formatting to each column.
Does this resemble the output you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a ton all!
I ended up using the Switch formula with multiple columns and assigning a numerical value to each colour I wanted to use.
Hi, @Anonymous
You can try the following method to write a measure about the color for each column. This is shown below.
Measure1 = Switch(True(),
SELECTEDVALUE('Table'[BCP])="G","Green",
SELECTEDVALUE('Table'[BCP])="A","Amber",
SELECTEDVALUE('Table'[BCP])="N","Red",
SELECTEDVALUE('Table'[BCP])="W","White")
Measure2 = Switch(True(),
SELECTEDVALUE('Table'[DR])="G","Green",
SELECTEDVALUE('Table'[DR])="A","Yellow",
SELECTEDVALUE('Table'[DR])="N","Red",
SELECTEDVALUE('Table'[DR])="W","White")
Measure3 = Switch(True(),
SELECTEDVALUE('Table'[IWsuraWce])="G","Green",
SELECTEDVALUE('Table'[IWsuraWce])="A","Yellow",
SELECTEDVALUE('Table'[IWsuraWce])="N","Red",
SELECTEDVALUE('Table'[IWsuraWce])="W","White")
Then add conditional formatting to each column.
Does this resemble the output you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You can not do conditional formatting for the column header. But you do for data cells
You can create a color measure and use that in conditional formatting using the field value option
example
Measure =
Switch(true(),
max(Table[Column]) = "R1" , "Red" ,
max(Table[Column]) = "R2" , "Green" ,
max(Table[Column]) = "R3" , "Pink "
)
How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539