Forum Discussion

PowerBINewbie_1's avatar
8 years ago
Solved

Too many arguments were passed to the AND function. The maximum argument count for the function is 2

Hi,   Can anyone help. I'm trying to get this formula to run and I keep getting this error message:   Too many arguments were passed to the DATESBETWEEN function. The maximum argument count for t...
  • Greg_Deckler's avatar
    8 years ago

    I believe you want:

     

    c_ARGB = 
    IF(
    	[ARG A]="",
    	0,
    	IF(
    		[ARG D]="",
    		CALCULATE(
    			SUM(DateTable[WORKDAY]),
    			DATESBETWEEN(
    				DateTable[Date],
    				'IC CMS List'[ARG A],
    				TODAY()
    			)
    		),
    		CALCULATE(
    			SUM(DateTable[WORKDAY]),
    			DATESBETWEEN(
    				DateTable[Date],
    				'IC CMS List'[ARG A],
    				'IC CMS List'[ARG D]
    			)
    		)
    	)
    )