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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

DAX formula help for multiple IF statements

Hi i am trying to create banding for with the following statement;

 

if [NumberOfUsers] <250 then "SME" else if [NumberOfUsers] >=250 <=1000 then "Corporate" else if ([NumberOfUsers] >=1000 <=5000 then "Enterprise" else if [NumberOfUsers] >=5000 then "Global" else "null"

 

What am i doing wrong? as all i reiceve is ERROR? any help would be great

8 REPLIES 8
CrisYan
Resolver III
Resolver III

The syntax for IF in DAX is:   

IF(CONDITION ; RESULTIFTRUE ; RESULTIFFALSE)

For multiple IF statements I recomend SWITCH(TRUE())

Measure = SWITCH(TRUE();
[NumberOfUsers] < 250; "SME";
[NumberOfUsers] < 1000 ; "Corporate";
[NumberOfUsers] < 5000 ; "Enterprise";
[NumberOfUsers] >= 5000 ; "Global";
BLANK())

 

 

Be aware of your limits ¿[NumberOfUsers] = 1000 is Corporate or Enterpise?.

 

Regards!

jthomson
Solution Sage
Solution Sage

You'd need to put && in your formulas in the right places to say it's both >=250 and <=1000 etc, but that whole >=250 is redundant, as anything less than 250 has already been called SME. Try nesting them - ask if it's less than 250, then go SME if true and your next if statement (checking if <1000) otherwise

Anonymous
Not applicable

but as i am looking to do the following anything 1-249 is SME, anything 250-999 is Corporate, anything 1000-4999 is Enterprise and anything over 5000 is Global 

 

Then my formula works.

The SWITCH(TRUE()) statement checks conditions in order, and stops if one condition is TRUE. So if number = 249, the formula will stop on the first statement and will return "SME", but if number = 250 it will skip the first statement and will stop on the second one, returning "corporate" (because 250< 1000).

Anonymous
Not applicable

am getting an error when doing this ;

 

The syntax for ';' is incorrect. (DAX(SWITCH(TRUE();[NumberOfUsers] < 250 ; "SME";[NumberOfUsers] < 1000 ; "Corporate";[NumberOfUsers] < 5000 ; "Enterprise";[NumberOfUsers] >= 5000 ; "Global";BLANK)).

 

Replace all ';' for ','.

 

(My PBI Desktop are with ';', yours must be with ',')

Anonymous
Not applicable

is there something i am missing to get this error; 

 

The value for 'userband' cannot be determined. Either 'userband' doesn't exist, or there is no current row for a column named 'userband'.

Hi @Anonymous

Use this formula

measure =
IF (
    [NumberOfUsers] < 250,
    "SME",
    IF (
        [NumberOfUsers] >= 250
            && [NumberOfUsers] <= 1000,
        "Corporate",
        IF ( [NumberOfUsers] > 1000 && [NumberOfUsers] <= 5000"Enterprise""Global" )
    )
)

I can't see 'userband' from all above, where do you use 'userband'?

 

 

Best Regards

Maggie

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors