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
LakshmiSree
Frequent Visitor

Conditional formatting is not working for decimal data type and % format

we are importing the data from excel with few calculated columns like Reliability, Margin Confidence, Quality and Revenue.

Built the table visual based on those columns and choose AVG aggregation on the field values and trying the conditional formatting if value  >= 0 and value <=60 then red, If values >= 61 and value <= 80 then yellow, if values >=81 and value <= 100 then green but not working the colors for exact values. it is taking the green value for yellow conditions.

PFB. like this its happening for other columns also

CTC Rel cdtn fmrt.PNG

I even tried below measure with sample color codes also but not worked:

CTC Reliability Color = SWITCH(
TRUE()
,AVERAGE('Reliability Sheet'[CTC Reliability (%)]) >=0 && AVERAGE('Reliability Sheet'[CTC Reliability (%)]) <= 60, "#f44242"
,AVERAGE('Reliability Sheet'[CTC Reliability (%)]) >=61 && AVERAGE('Reliability Sheet'[CTC Reliability (%)]) <= 80, "#f4f142"
,AVERAGE('Reliability Sheet'[CTC Reliability (%)]) >=81 && AVERAGE('Reliability Sheet'[CTC Reliability (%)]) <= 100, "#5ff442",
"#f44242"
)
8 REPLIES 8
az38
Community Champion
Community Champion

Hi @LakshmiSree 

first, I see a hole in your statement.

values between 60 and 61 and values between 80 and 81 will not be affected by conditional formatting rules

 

second, how do you get  a column "Average ofCTC Reliability (%)" on screenshot? is it a measure (if yes, show a formula) or just aggregation in visual?

 

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

LinkedIn


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

What I observed is, If I apply for one column its working fine. If I apply for multiple columns its not working properly.

az38
Community Champion
Community Champion

@LakshmiSree 

well, I think the key is not in conditional formatting. it's about correct average calculate. you need to define how to you want to calculate it. what filter should be applied to statement and so on. next, check your formula and real data. then, conditional formatting should work ok

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

 


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

That is not a measure. "CTC Reliability" is the column and applied the AVG on the table visual field.

FYR.

 

CTC Rel cdtn fmrt 1.PNG

So the above one did not work and i used the above measure(in first post)

az38
Community Champion
Community Champion

@LakshmiSree 

It's not completely understandable for me.

I see in the Conditional formatting dialog window you are trying to apply Average Summarization to "Average field". It looks like you get here average of average.

I dont know all your data model, but it seems like there is some inconsistance in the formulas

anyway, calculation AVERAGE can easily be different with AVG in visual. it because of row-context.

try to add new measure 

CheckMeasure = AVERAGE('Reliability Sheet'[CTC Reliability (%)])

and add it as column to visual to check

 

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


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

PFB. I believe now you can understand.

Table Visual.

CTC Rel 2.PNG

Conditional Formatting.

CTC Rel cdtn fmrt 1.PNG

az38
Community Champion
Community Champion

@LakshmiSree 

it doest clear anything without source data. sorry, screenshots only display the high level of report

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


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

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.