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

Help with measure - IF Condition in between does not work

Hi!

So I am creating somehow a 'traffic light' indicator for a chart. It's basically a pie chart that turns to green OR red when the value is true from a measure 

annlois_0-1642069935021.png

 

Column1Green = IF(SUM(Column1[count])<=8681,1,0)
Column1Red = IF(SUM(Column1[count])>9838.466666666667,1,0)

 

This is working. Now i am trying to put yellow as an indicator when its between 8681 and 9838.

But it's not working. Any leads on how I can make this work?

Here's the measure I created for when it needs to turn to yellow:

Column1Yellow = IF(and(SUM(Column1[count])>8681,SUM(Column1[count]))<9838.466666666667,1,0)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@annlois , Create a measure like this and use in conditional formatting using field value option

 

measure =
var _1 = SUM(Column1[count])
return
Switch(True(),
_1 <=8681 , "Green" ,
_1 >9838.466666666667, "Red" ,
"Yellow"
)

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@annlois , Create a measure like this and use in conditional formatting using field value option

 

measure =
var _1 = SUM(Column1[count])
return
Switch(True(),
_1 <=8681 , "Green" ,
_1 >9838.466666666667, "Red" ,
"Yellow"
)

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

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.