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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
o59393
Post Prodigy
Post Prodigy

Conditional formatting now working right with Power BI

Hi all

 

I am using a conditional formatting with the following rules.

 

If equal to 1 then green

If >= 0 and less than 1 then red

If greater than 1 then red

sadsaaa.JPG

 

There seems to be something wrong with Power BI:

 

dsfdsfsfsd.JPG

 

I dont know why is taking the 1 values as red as seen above.

 

Any idea what could be wrong?

 

Here is the pbix

 

https://1drv.ms/u/s!ApgeWwGTKtFdhyDsUmWn7PR4vNTY?e=9kjOQF

 

Thanks

 

1 ACCEPTED SOLUTION
nandukrishnavs
Community Champion
Community Champion

@o59393 

 

The issue with the decimal part. 

Try to use below DAX measure for applying the conditional formatting.

Color = 
VAR __val =
    ROUND ( [Check mix], 2 )
VAR __result =
    SWITCH (
        TRUE (),
        __val = 1, "Green",
        AND ( __val >= 0, __val < 1 ), "Red",
        __val > 1, "Red"
    )
RETURN
    __result

 

nandukrishnavs_0-1597647071500.png

nandukrishnavs_1-1597647103889.png



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 

 


Regards,
Nandu Krishna

View solution in original post

2 REPLIES 2
nandukrishnavs
Community Champion
Community Champion

@o59393 

 

The issue with the decimal part. 

Try to use below DAX measure for applying the conditional formatting.

Color = 
VAR __val =
    ROUND ( [Check mix], 2 )
VAR __result =
    SWITCH (
        TRUE (),
        __val = 1, "Green",
        AND ( __val >= 0, __val < 1 ), "Red",
        __val > 1, "Red"
    )
RETURN
    __result

 

nandukrishnavs_0-1597647071500.png

nandukrishnavs_1-1597647103889.png



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 

 


Regards,
Nandu Krishna

amitchandak
Super User
Super User

@o59393 ,

Create a color meausre and try (example) with "Field" option in conditional formating

Color Date = if(FIRSTNONBLANK('Date'[Date],TODAY()) <today(),"lightgreen","red")

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")

 

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

 

Also try with 1.0 , 0.0 etc in rules

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors