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
Dee
Helper III
Helper III

Compare greater than 0 but less than 2 in dax using IF statement

Hi all,

 

I would love to do a comparison that checks if the value in a column is greater than 0 but less than 2,

 

eg

IF( A[BBB]>0 AND <= 2, "RRR", " NNN), "000)

 

Any idea how I can tweak that for it not to throw an error.

 

 

1 ACCEPTED SOLUTION
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

Something like this should work:

 

IF( Table[column] > 0 && Table[column] <=2,"ResultTrue","ResultFalse")

or if you want to use switch:

SWITCH(TRUE(),Table[column] > 0 && Table[column] <=2,"ResultTrue","ResultFalse") 

View solution in original post

2 REPLIES 2
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

Something like this should work:

 

IF( Table[column] > 0 && Table[column] <=2,"ResultTrue","ResultFalse")

or if you want to use switch:

SWITCH(TRUE(),Table[column] > 0 && Table[column] <=2,"ResultTrue","ResultFalse") 

Thank you!!

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.