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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Juanpablocl96
Frequent Visitor

IF condition error, trying to get something similar to an IFS function

I'm currently trying to get a measure that sets the value as 1 per row and sums them for every row in the Opportunity table that has an existing value in the column fecha_de_admision__c, but the column Fecha_de_inscrito__c must be empty and the column StageName must not be "Descartado.

 

Also tried to do an if statement using the function AND as well, but didn't work either.

 

Currently using this formula:

Admitidos = (if(Opportunity[fecha_de_admision__c]<>blank(),if(Opportunity[Fecha_de_inscrito__c]=blank(),if(Opportunity[StageName]<>"Descartado",blank()),blank()),blank(),1))

 

And getting this error:
Too many arguments were passed to the IF function. The maximum argument count for the function is 3.

1 ACCEPTED SOLUTION

Hi @Juanpablocl96 
Please try

Admitidos =
IF (
    SELECTEDVALUE ( Opportunity[fecha_de_admision__c] ) <> BLANK ()
        && SELECTEDVALUE ( Opportunity[Fecha_de_inscrito__c] ) = BLANK ()
        && SELECTEDVALUE ( Opportunity[StageName] ) <> "Descartado",
    1
)

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@Juanpablocl96 First, I would highly recommend that you convert this to a SWITCH(TRUE(),...) statement. Much cleaner. You likely have a syntax error where you are not ending an IF statement properly. You might want something like:

Admitidos = 
if(
    Opportunity[fecha_de_admision__c]<>blank(),
    if(Opportunity[Fecha_de_inscrito__c]=blank(),
      if(Opportunity[StageName]<>"Descartado",
        blank(),
        blank()
      ),
      blank()
    )
    ,1
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thanks for trying to help! With the function you just gave me I get the exact same error as I got when trying the IF & AND functions, which is:
A single value for column 'StageName' in table 'Opportunity' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Not sure what this error means. I'll try to formulate a function with a switch true.

 

Thanks for the help!

Hi @Juanpablocl96 
Please try

Admitidos =
IF (
    SELECTEDVALUE ( Opportunity[fecha_de_admision__c] ) <> BLANK ()
        && SELECTEDVALUE ( Opportunity[Fecha_de_inscrito__c] ) = BLANK ()
        && SELECTEDVALUE ( Opportunity[StageName] ) <> "Descartado",
    1
)

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.