Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Efsteps
Frequent Visitor

Make conditional formatting with text instead of color

Hi to everyone 

I need to make a card visual that shows me text based on a numeric or percentage value 

By example if the value is 1 in the card visual appear the text “We need to Improve” or if the value is 5 in the visual card, the text to show is “Great Job!” and if it’s possible at the same time the color text changes with the same conditions.

There’s a way to do it?

Thank you very much for reading!

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Efsteps ,

 

Refer this measure.

Measure = IF(NOT(ISFILTERED('Table'[id])),"please select id",SWITCH(SELECTEDVALUE('Table'[value]),1,"We need to Improve",5,"Great Job!"))

Here's my sample data.

1.PNG

2.PNG

3.PNG

4.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @Efsteps ,

 

Refer this measure.

Measure = IF(NOT(ISFILTERED('Table'[id])),"please select id",SWITCH(SELECTEDVALUE('Table'[value]),1,"We need to Improve",5,"Great Job!"))

Here's my sample data.

1.PNG

2.PNG

3.PNG

4.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Efsteps , You have create a formula that will return “We need to Improve” and others. Create a same formula, it should return color for that text so when formula returns “We need to Improve”, you return green

Example

color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)

. In conditional formatting, you can choose field and a color measure post that

Refer for steps

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

How can be the formula taking apart the colors condition, just need to make a value  converted to text?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.