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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ruta
Frequent Visitor

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
1 ACCEPTED SOLUTION
tex628
Community Champion
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.



Connect on LinkedIn

View solution in original post

4 REPLIES 4
evandrocunico
Resolver III
Resolver III

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.

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


Connect on LinkedIn
tex628
Community Champion
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.



Connect on LinkedIn
ruta
Frequent Visitor

Thank you so much! Works just fine now 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.