cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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;

 Red Amber Green 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.

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

2 REPLIES 2
Anonymous
Not applicable

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors