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
Giada_Togliatti
Post Patron
Post Patron

conditional formatting doesn't work

Hi,

I've created a table with three measure and the result is a table with only one row that shows the total of each measure.

I've applied conditional formatting to one measure but it doesn't work, why?

In attached an example

Untitled.png

Thank you

Giada

 

13 REPLIES 13

@amitchandak , @Tahreem24 , @az38  I've applied the same conditional formatting I need (a conditional formatting based on another measure) and it works, why if I tried to use the same in a table like the attached on it doesn't work?

In attached an example: if I add a dimension like product name and I have more rows it works

 

 

Untitled.png

 

If I remove product name is again without colorUntitled1.png

This is my question, I hope I've explained well my problem in real case

@Giada_Togliatti ,this is because the range will change, In fact, for one value those ranges might not apply. What are the conditions you are using?

 

Try to create a color measure with help from isinscope and isfilter and use that with "Field" option

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"
)

 

refer for isinscope

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

 

Use of color measure

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak I can't use FIRSTNONBLANK with a measure, in the formula I used a measure inside another measure

example = Switch( true(),
V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite superiore'[Limite superiore 1]), "red",
V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite inferiore'[Limite inferiore 1]) &&
V_REPORT_PPM_RISORSE[measure1]<selectedvalue('Limite superiore'[Limite superiore 1]), "light green","yellow")

 

and, do you know if it's possible to apply conditional formatting for total in a table?

Hi,

 

You should change the 'Apply to' options to Values only:

 

Capture.PNG

 

Best Regards,

Dedmon Dai

@Giada_Togliatti 

it depends on your measure statements


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@amitchandak the measure used for conditional formatting that work with more rows but not with one row is this:

example = Switch( true(),
V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite superiore'[Limite superiore 1]), "red",
V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite inferiore'[Limite inferiore 1]) && V_REPORT_PPM_RISORSE[measure1]<selectedvalue('Limite superiore'[Limite superiore 1]), "light green","yellow")
 
where limite superiore and limite inferiore are two parameter
Tahreem24
Super User
Super User

@Giada_Togliatti ,

Better to provide some more deets on your conditional formatting.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
az38
Community Champion
Community Champion

@Giada_Togliatti 

it depends on:

a) how exactly do you calculate your measure

b) how exactly do you implement conditional formatting

 

please, provide details


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Total sales is sum of column Sales and Total profit is Sum of column Profit, I want to create a conditional formatting of Total Sales, something like this: Untitled.png

But it doesn't color anything

This is just an example.

What I want to do in real data is something like conditional formatting in total rows in a table

 

@Giada_Togliatti 

try to set -999 999 999 999 instead of Minimum and 999 999 999 999 instead of Maximum

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@Giada_Togliatti ,

please make it  like below screen shot:

and set the color according to you.

Capture.PNG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Giada_Togliatti ,

FYI, My measure is in percentage form so that's why I took percentage under conditional formatting. 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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 Fabric 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.