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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Conditional Formatting - on live connection

Hi Experts

 

I cannot get the resuts of the following dax to show the negative numbers as red........

 

vAOP$ = 
VAR SummaryItem = SELECTEDVALUE( 'Templates'[Summary 1] )
    Return

SWITCH(TRUE(),
    SummaryItem = "EMEA", FORMAT([EMEA Revenue vAOP$ 2],"#,##0.0%;(#,##0.0%)"),
    SummaryItem = "Americas", FORMAT([Americas Revenue vAOP$ 2],"#,##0.0%;(#,##0.0%)"),
    SummaryItem = "APAC", FORMAT([APAC Revenue vAOP$ 2],"#,##0.0%;(#,##0.0%)"),
    SummaryItem = "IDIS", FORMAT([ID & IS Revenue vAOP$ 2],"#,##0.0%;(#,##0.0%)"),
    SummaryItem = "Total", FORMAT([$NSvPY4% (NOE @ AOP Rate)],"#,##0.0%;(#,##0.0%)"),
        ISBLANK(SummaryItem),FORMAT(0.0,"$#,##0.0;($#,##0.0)"))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello again,

 

You have to add this measure:

vAOP$_Color = 
SWITCH(TRUE(), 
[vAOP$] <0, "#ff0000",
BLANK())

Then you need to do the following steps:

Conditional Formating DAX.png

 

Hope that this works!

Kind Regards,

 

EDIT: I see that i picked Background color instead of Font color by conditional formatting.

This should be Font color.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

I am also experiencing a similar problem. I am connecting with the PowerBI dataset via Live connection and cant use conditional formatting on the text of any object via dax measure.

Anonymous
Not applicable

@Anonymous Did you find a asolution for this problem?

Anonymous
Not applicable

@Anonymous  I think I was missing a simple step. After creating a measure, change the datatype of measure to text. Cause by default it was Number and that's why couldn't be used.

I hope that will solve your problem too.

Anonymous
Not applicable

@Anonymous That did the trick. Thank you!

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

What is your data source? I tested with live connection to SQL Server DB and SSAS Multidimensional model, conditional formatting option is available in both scenario.

 

Would you please post a screenshot? And update your Power BI desktop for a test.

 

Regards,

Yuliana Gu 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello again,

 

You have to add this measure:

vAOP$_Color = 
SWITCH(TRUE(), 
[vAOP$] <0, "#ff0000",
BLANK())

Then you need to do the following steps:

Conditional Formating DAX.png

 

Hope that this works!

Kind Regards,

 

EDIT: I see that i picked Background color instead of Font color by conditional formatting.

This should be Font color.

Anonymous
Not applicable

Hi Jeltex

 

my connection into Power Bi is a Live Connection that option os disabled.....

Anonymous
Not applicable

Is it possible to use conditional formatting on any value or is it disabled at your whole report?

Never used live connections before so I don't really know.

 

If it is disabled I don't think that it is possible right now.

You might want to create a new idea at this link.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors