Forum Discussion

dd88's avatar
dd88
Icon for Post Patron rankPost Patron
1 year ago
Solved

Too few arguments were passed to the IF function. The minimum argument count for the function is 2

Too few arguments were passed to the IF function. The minimum argument count for the function is 2.

Was working, now DAX is displaying the error.

How can this be resolved?

 

The condition is

 

if LONG TERM PLACEMENTS <>
  N/A
  AND Blank
  AND NO PLACEMENT
Then
    Count remainder

 

CountPlacements = if(AND(Table_DATA[LONG TERM PLACEMENTS] <>"N/A", ISBLANK(Table_DATA[LONG TERM PLACEMENTS])) && (Table_DATA[LONG TERM PLACEMENTS]<>"NO PLACEMENT"))

 

TIA

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi dd88 ,

     

    The key is that you only provided the logical test part of the IF function and didn't include the TRUE result, meaning the part after THEN is missing. Please try:

     

    if(
       AND(
          Table_DATA[LONG TERM PLACEMENTS] <>"N/A",
    	  ISBLANK(Table_DATA[LONG TERM PLACEMENTS])
    	  ) && 
       (Table_DATA[LONG TERM PLACEMENTS]<>"NO PLACEMENT"),
       "Count remainder"   
       )

     

     

    Best Regards,

    Bof

  • Hi dd88,

    Use this updated measure to achieve your goal:

     

    CountPlacements = 
    IF(
        (Table_DATA[LONG TERM PLACEMENTS] <> "N/A" &&
        Table_DATA[LONG TERM PLACEMENTS] <> "NO PLACEMENT" &&
        NOT(ISBLANK(Table_DATA[LONG TERM PLACEMENTS]))),
        "Count Reminder"
    )

     

3 Replies

  • Hi,

    Try this

    CountPlacements = if(Table_DATA[LONG TERM PLACEMENTS] <>"N/A"||ISBLANK(Table_DATA[LONG TERM PLACEMENTS])||Table_DATA[LONG TERM PLACEMENTS]<>"NO PLACEMENT"

    If this does not work, then try replacing || with &&

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi dd88 ,

     

    The key is that you only provided the logical test part of the IF function and didn't include the TRUE result, meaning the part after THEN is missing. Please try:

     

    if(
       AND(
          Table_DATA[LONG TERM PLACEMENTS] <>"N/A",
    	  ISBLANK(Table_DATA[LONG TERM PLACEMENTS])
    	  ) && 
       (Table_DATA[LONG TERM PLACEMENTS]<>"NO PLACEMENT"),
       "Count remainder"   
       )

     

     

    Best Regards,

    Bof

  • Hi dd88,

    Use this updated measure to achieve your goal:

     

    CountPlacements = 
    IF(
        (Table_DATA[LONG TERM PLACEMENTS] <> "N/A" &&
        Table_DATA[LONG TERM PLACEMENTS] <> "NO PLACEMENT" &&
        NOT(ISBLANK(Table_DATA[LONG TERM PLACEMENTS]))),
        "Count Reminder"
    )