The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi there,
I have a matrix which brings in Overall Status Assessment that is a text field that contains Red, Amber & Green. I would like to do conditional formatting which uses icons however it seems that conditional formatting can only be done using number fields.
So I'm thinking that I need to create a new measure called Overall Status Number with IF statements I guess that does the following:
If Red then 1
If Amber then 2
If Green then 3
This way, I can use this in the conditional formatting rules that brings in either red, amber or green based on whether it's 1, 2 or 3.
Table Name = Work
Field Name with Red, Amber & Green = Overall Status Assessment
New Measure to be created Overall Status Number
I hope I'm on the right track. If not please advise how else I can do this.
Solved! Go to Solution.
Hi Arul,
Thanks, I got it to work. Just Power BI not playing nice, so instead of copying & pasting in the measure formula that you provided, I re-wrote it manually which then invokes the auto-populate feature for functions and it worked.
Thanks
Darren
Hi Arul,
Thanks, I got it to work. Just Power BI not playing nice, so instead of copying & pasting in the measure formula that you provided, I re-wrote it manually which then invokes the auto-populate feature for functions and it worked.
Thanks
Darren
can you mark my measure as solution, thx
Thanks Arul,
I think I still must be doing something wrong.
1. When I bring in the Overall Status Assessment into a standalone table, all good as expected it returns the red, amber, green.
2. The numbers Measure formula is accepted as you provided, so all good there.
3. When I bring in the New Numbers Measure itself to appear as a table with just that field it errors and then when I try bring it in into the table together with the Overall Status, it errors.
4. And then finally, which is what I'm actually trying to do with the conditional formatting to set icons based on the value of 1, 2 or 3.
It errors.
Any further help you can provide would be greatly appreciated,
Thanks
Darren
Whats the error message in "See details"?
Hi,
try
NumbersMeasure =
VAR rowValue = SELECTEDVALUE(Work[Overall Status Assessment])
RETURN SWITCH(
TRUE(),
rowValue = "Red", 1,
rowValue = "Amber", 2,
rowValue = "Green", 3,
-1
)
@Anonymous ,
you are on a right track and you also consider below method as well,
https://community.powerbi.com/t5/Desktop/Conditional-Formatting-Text-Field/m-p/1661482
Thanks,