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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

I have a question with If statement

I am trying to write an If statements for three conditions like 

Rating =
IF((Sheet0[Likelihood to recommend])<7,"Detractors",
(Sheet0[Likelihood to recommend])>8,"Promotors",
(Sheet0[Likelihood to recommend])>6,"Passive"). 
 
But I get an error like 
Too many arguments were passed to the IF function. The maximum argument count for the function is 3.
Could anyone help with this 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Figured out it worked with switch function

Rating = SWITCH(TRUE(),
Sheet0[Likelihood to recommend]<7,"Detractors",
Sheet0[Likelihood to recommend]>8,"Promotors",
Sheet0[Likelihood to recommend]>6,"Passive","No data")

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Figured out it worked with switch function

Rating = SWITCH(TRUE(),
Sheet0[Likelihood to recommend]<7,"Detractors",
Sheet0[Likelihood to recommend]>8,"Promotors",
Sheet0[Likelihood to recommend]>6,"Passive","No data")
Anonymous
Not applicable

Hi James, thanks for your help but  I still get the syntax error 

 

The syntax for ')' is incorrect. (DAX(IF((Sheet0[Likelihood to recommend])<7,"Detractors",if(Sheet0[Likelihood to recommend])>8,"Promotors",(Sheet0[Likelihood to recommend])>6,"Passive")))).

Anonymous
Not applicable

Rating =
IF((Sheet0[Likelihood to recommend])<7,"Detractors",
if(Sheet0[Likelihood to recommend])>8,"Promotors",
(Sheet0[Likelihood to recommend])>6,"Passive"))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.