cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
GuillemXII Regular Visitor
Regular Visitor

Conditional Formatting a Text Measure in a Matrix

Hi everyone, 

 

I've been trying to apply a conditional format to a calculated measure with text values but without success:

Matrix BI.jpg

 

I would like that in the last column ("Nivel Entrevista") depending on the text, the background color changed as following: 

 

"Nivel 1": Green 
"Nivel 2": Yellow (it says "Yellow", and no, is not just you who doesn't manage to read it Smiley LOL)
"Nivel 3": Orange
"Nivel 4": Red

BLANK: regular format

Any help will be much appreciated!

 

Thank you all!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Conditional Formatting a Text Measure in a Matrix

Hi @GuillemXII 

Don't use "EVALUATE" or "DEFINE" in the formula.

You may click "new table" by mistake.

Please use the formula as Gordonlilj provided in the "New column".

If you need a measure,

Create a measure

(assume 'Table'[Nivel] is a measure too, if not, replace with  Max('Table'[Nivel])

Calc measure= 
Switch(TRUE(),
        'Table'[Nivel] ="Nivel 4",4,
        'Table'[Nivel] ="Nivel 3",3,
        'Table'[Nivel] ="Nivel 2",2,
        'Table'[Nivel] ="Nivel 1",1
)

Then use the measure to configure color conditionally.

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting

 

Best Regards
Maggie

 

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

5 REPLIES 5
Gordonlilj Established Member
Established Member

Re: Conditional Formatting a Text Measure in a Matrix

Hi,

 

One thing you could try is first creating a calculated column using something like this

 

CalcColumn= 
Switch(TRUE(),
        'Table'[Nivel] ="Nivel 4",4,
        'Table'[Nivel] ="Nivel 3",3,
        'Table'[Nivel] ="Nivel 2",2,
        'Table'[Nivel] ="Nivel 1",1
)

 

Then you could set up conditional formatting like this and it should work

 

 

 

Capture.PNG

 

GuillemXII Regular Visitor
Regular Visitor

Re: Conditional Formatting a Text Measure in a Matrix

Hi @Gordonlilj , 

 

I've tried to apply your method but it's telling me that "the expression specified in the query is not a valid table expression"...

 

Any other idea?

 

Thank you anyway!

Community Support Team
Community Support Team

Re: Conditional Formatting a Text Measure in a Matrix

Hi @GuillemXII 

Don't use "EVALUATE" or "DEFINE" in the formula.

You may click "new table" by mistake.

Please use the formula as Gordonlilj provided in the "New column".

If you need a measure,

Create a measure

(assume 'Table'[Nivel] is a measure too, if not, replace with  Max('Table'[Nivel])

Calc measure= 
Switch(TRUE(),
        'Table'[Nivel] ="Nivel 4",4,
        'Table'[Nivel] ="Nivel 3",3,
        'Table'[Nivel] ="Nivel 2",2,
        'Table'[Nivel] ="Nivel 1",1
)

Then use the measure to configure color conditionally.

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting

 

Best Regards
Maggie

 

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

Community Support Team
Community Support Team

Re: Conditional Formatting a Text Measure in a Matrix

Hi @GuillemXII 

Is this problem sloved? 

If it is sloved, could you kindly accept it as a solution to close this case?

If not, please let me know.

 

Best Regards

Maggie

GuillemXII Regular Visitor
Regular Visitor

Re: Conditional Formatting a Text Measure in a Matrix

Sorry @v-juanli-msft for not answering earlier. 

 

Yes, it's been solved now!

 

Thank you both!

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 116 members 1,735 guests
Please welcome our newest community members: