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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
navedkhan
Helper III
Helper III

DAX code for "greater than and less than" by way of if function

I want to write a dax function with "IF" condition basis following logic;

 

 RedAmberGreen
T1<= 20>20 and <=50> 50
T2<=90>90 and <=120>120

 

So if Value falls in either of 3 categories (Red, Amber or Green); accordingly IF condition to calculate. my biggest problem occurs in 'Amber' column where a range of values need to be written in DAX.

Any help please?

 

@Zubair_Muhammad @Greg_Deckler 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I think this should do it.

 

=if(T1 <=20, "Red", if(T1 <=50, "Amber", "Green"))

=if(T2 <=90, "Red", if(T2 <=120, "Amber","Green"))

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@navedkhan 

 

You can try the below

 

1. IF(K11<=20,"red",IF(K11>50,"Green","Amber"))

2. IF(K11<=90,"red",IF(K11>120,"Green","Amber"))

 

 

Nandri

Anonymous
Not applicable

I think this should do it.

 

=if(T1 <=20, "Red", if(T1 <=50, "Amber", "Green"))

=if(T2 <=90, "Red", if(T2 <=120, "Amber","Green"))

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.