Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a Card in a power BI Dashboard that that displays roughly 6 unique text attributes depending on the input. How do I add a separate color to each attribute, for example if the card displays "apple" I want that text to be red.
hi @Anonymous
Thanks for the reply, I'm farely new to Power BI but what does #F0F0F0";"#FFE4B5 mean?
I know this dosen't work but I think this is close to what I want. How could I fix this to get each text value assigned to a color.
Test Color = VAR Color = SELECTEDVALUE(Table[Color])
Return
SWITCH(TRUE(),
Color = "#FF0000", "Apple" )
Then Conditional format by field Value
Your first question for example if the card displays "apple" I want that text to be red
Measure:
Hate to bother you again but I tried the code you suggested and it pretty much worked however it displays "#ff0000" in red, and not the text like "Apple" in red.
What I have:
@Anonymous can you show data table, please?
I can't show the exact table due to confidentiality and I understand if you can't solve this because of that, but essentialy I have a table called food:
Food
I only care about the Fruit attribute inside the food table
@Anonymous create a measure:
sel_fruit = SELECTEDVALUE(Colors[Color])
show measure by card and filter option...
the result is Apple?
ps. excellent channel about power bi https://www.youtube.com/watch?v=zHzSBNES6jE