Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

If statement "too few arguments"

Hi all,

 

I am using power BI for the first time and I am struggling a bit to write an IF function. Idea is very basic, I need to check a cell value (days overdue) and then return a corresponding text.

AgingBucket = IF([LOOKUP] ('As of 6 30 2019'[Days Overdue] )<0,"not due",IF([LOOKUP] ('As of 6 30 2019'[Days Overdue] )<61,"61-90", IF([LOOKUP]('As of 6 30 2019'[Days Overdue] )<61, "61-90",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<121,"91-120",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<151,"121-150",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<181,"151-180",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<366,"181-365",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]>365,"1+Years")))))))))))))
Yet, error says :too few arguments were passed to the IF function. The minimum argument count for the function is 2.
Not sure how to solve this and what's the issue..
Any help would be very much appreciated!
Cheers,
ruta
  • AgingBucket =
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<0,"not due",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<61,"61-90", 
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<61, "61-90",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<121,"91-120",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<151,"121-150",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<181,"151-180",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<366,"181-365",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])>365,"1+Years" WE NEED ELSE STATEMENT HERE
    )))))))))))))

    Missing else on the last IF and missing ")" on a few IF's.


4 Replies

  • tex628's avatar
    tex628
    Community Champion
    AgingBucket =
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<0,"not due",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<61,"61-90", 
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<61, "61-90",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<121,"91-120",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<151,"121-150",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<181,"151-180",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])<366,"181-365",
    IF(
    [LOOKUP]('As of 6 30 2019'[Days Overdue])>365,"1+Years" WE NEED ELSE STATEMENT HERE
    )))))))))))))

    Missing else on the last IF and missing ")" on a few IF's.


    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much! Works just fine now :)

  • Hi, look at the last IF...

     

    AgingBucket = IF([LOOKUP] ('As of 6 30 2019'[Days Overdue] )<0,"not due",IF([LOOKUP] ('As of 6 30 2019'[Days Overdue] )<61,"61-90", IF([LOOKUP]('As of 6 30 2019'[Days Overdue] )<61, "61-90",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<121,"91-120",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<151,"121-150",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<181,"151-180",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]<366,"181-365",IF([LOOKUP]('As of 6 30 2019'[Days Overdue]>365,"1+Years","second parameter")))))))))))))

     

    Regards.

    • tex628's avatar
      tex628
      Community Champion

      You havent closed the lookups. They need to be closed with a ")". Take a look at my previous comment!