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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Satz27
Frequent Visitor

Change card color dynamically using measures

I have a case related to text coloring based on predefined conditions (<95% green, 95-99% yellow, > 100% red). currently I use the color feature in the data label, but the colors that appear do not match, some are >100% red, some are green.

 

the following measures I use :

IF(SELECTEDVALUE('2  Operation Metrics'[Operational Metrics]) = "Productivity",
IF(SELECTEDVALUE('2  Operation Metrics'[Product]) = "Gondorukem",
IFERROR("(" &ROUND(100*([_OM_Actual]/[_OM_Target]),0)& "% Target)", "N/A"),
IFERROR("(" &ROUND(100*([_OM_Actual_Average]/[_OM_Target_Ach]),0)& "% Target)","N/A")),
IFERROR("(" &ROUND(100*([_OM_Actual_Average]/[_OM_Target_Ach]),0)& "% Target)","N/A"))

I want to create conditions using measures not using color labels, can anyone help me with what steps?

2 ACCEPTED SOLUTIONS
themistoklis
Community Champion
Community Champion

@Satz27 

This measure with the colours that you created must be used in conditional formatting not in the values section of the visual.

 

So, add a card visual (if this is the visual that you use)

Add the metric _OM_YTDSnapshotRendemen to this visual

 

Now go to format options of the visual --> Click on Data Label --> then fx

Format by: Field

Select the new measure field that you created with the color formula

 

color.JPG

 

View solution in original post

6 REPLIES 6
themistoklis
Community Champion
Community Champion

I tried but the result that appears error x

Satz27_0-1632900104458.png

 

measures _OM_YTDSnapshotRendemen :

IF(SELECTEDVALUE('2  Operation Metrics'[Operational Metrics]) = "Productivity",
IF(SELECTEDVALUE('2  Operation Metrics'[Product]) = "Gondorukem",
IFERROR("(" &ROUND(100*([_OM_Actual]/[_OM_Target]),0)& "% Target)", "N/A"),
IFERROR("(" &ROUND(100*([_OM_Actual_Average]/[_OM_Target_Ach]),0)& "% Target)","N/A")),
IFERROR("(" &ROUND(100*([_OM_Actual_Average]/[_OM_Target_Ach]),0)& "% Target)","N/A"))

 

@Satz27 

 

It seems that the measure _OM_YTDSnapshotRendemen doesnt return a number but a text. Is that correct?

 

Try to wrap this measure in a VALUE function. Like below:

VALUE([_OM_YTDSnapshotRendemen])>100, "Red"

for the number it's not text but I added punctuation text () & and Target text, I've temporarily deleted () & and Target but what comes out is not a colored number but text as I screenshot.

Satz27_0-1632901294560.png

 

@Satz27 

This measure with the colours that you created must be used in conditional formatting not in the values section of the visual.

 

So, add a card visual (if this is the visual that you use)

Add the metric _OM_YTDSnapshotRendemen to this visual

 

Now go to format options of the visual --> Click on Data Label --> then fx

Format by: Field

Select the new measure field that you created with the color formula

 

color.JPG

 

thank you case resolved.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.