I am a new user of power BI, I have quite the complex formula in excel that return conditional values. I tried to put it in Power BI however the error:
"Too many arguments were passed to the OR function. The maximum argument count for the function is 2." happens.
While this works perfectly in Excel. Could you help me see what could be changes in it and convert it in DAX ? Thank you
The Excel forumula is:
=IF([@[Aa]]="YES";IF(OR(ISNUMBER(SEARCH("TM TD";[@[Bb]];1));[@[Bb]]="TM BOLOGNA";[@[Bb]]="TM TOLOS";[@[Bb]]="PROJECT");IF(AND([@[Cc]]=0;OR([@[Dd]]="";[@[Ee]]=""));"valid";"conflict");IF(AND([@[Cc]]=1;AND([@[Dd]]>0;[@[Ee]]>0));"conflict";IF(OR([@[Ff]]=1;[@[Gg]]=1);"valid";IF(AND([@[Hh]]="SECTOR";[@[Ii]]=[@[Jj]];[@[Jj]]=[@[Kk]]);"sector ag";""))));"N/A")
The current DAX formula that gives me the error is :
Sitation = IF(Sheet1[Aa]="YES",
Sheet1[Bb]="TM BOLOGNA",Sheet1[Bb]="TM TOLOS",Sheet1[Bb]="PROJECT"),
Solved! Go to Solution.
Hi @Elios ,
It seems your are passing multiple conditions to OR function? OR function accepts only 2 parameters.
If you need multiple conditions in OR function, use this syntax:
If(Table[Criteria1] = "A" || Table[Criteria2] = "B" || Table[Criteria3] = "C" || ...
Thank you that seems to be what I need, what are the || ? Do they play a similar role to the OR function ?
Also I have a similar problem with the AND function that is less flexible than on excel. Do you have any idea how to replace it with something that can accept more than 2 parameters ?
@Elios It will be much easier if you share sample data and the expected output of this column. Read this post to get your answer quickly.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.