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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
MRad
Regular Visitor

Overload resolution failed because no accessible 'IIf' accepts this number of arguments.

Hello everyone:

I am building Paginated Report in PBI and would like to have a Dynamic Report Title.  All my components work fine but put together gives an error stating that IIF cannot take too many arguments.  I am very new to PBI and would be grateful for any help.  In business terms what I am saying is if user does not enter the paraemter than use the first condition else second conidtion:

=IIf(Parameters!FromDate.Value IsBlank,

"Cost from " + IF(MONTH(TODAY()) <= 6,Year(TODAY()) -1 &"/07/01",Year(TODAY()) &"/07/01")
+ " to " + IF(MONTH(TODAY()) <= 6,Year(TODAY()) & "/" &RIGHT("00"& MONTH(TODAY()),2)&"/01", Year(TODAY()) -1 & RIGHT("00"& MONTH(TODAY()),2)&"/01")
,
"Cost from " +FormatDateTime(Parameters!FromDate.Value, DateFormat.ShortDate) +" to "+ FormatDateTime(Parameters!ToDate.Value, DateFormat.ShortDate)
)

 

MR

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @hackcrr , allow me to provide a supplement to the approach you gave:
Hi,@MRad 

Regarding the issue you raised, my solution is as follows:

 According to the screenshot of your error report, the main reason is that the citation isbank function can not be called, the reason for this situation is because you use the function of DAX in powerquery, in Power Query M language, there is no direct ISBLANK function, but you can use other methods to determine whether it is empty or not:
1. Table.IsEmpty().To check if the table is empty, here is a simple output:

vlinyulumsft_0-1716282470080.png

Below are links to the relevant documentation:

 Table.IsEmpty - PowerQuery M | Microsoft Learn
2.List.IsEmpty().Checks if the column is empty, here is a simple output:

vlinyulumsft_1-1716282499727.png

Below are links to the relevant documentation:

List.IsEmpty - PowerQuery M | Microsoft Learn

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
hackcrr
Super User
Super User

Hi, @MRad 

In a Power BI DAX or M query, you should use IF instead of IIf, and you may want to use the & operator in string concatenation. Here is a modified expression:

= IF(  
    ISBLANK(Parameters!FromDate.Value),  
    "Cost from "   
    & IF(MONTH(TODAY()) <= 6,   
        FORMAT(DATE(YEAR(TODAY()) - 1, 7, 1), "yyyy/MM/dd"),   
        FORMAT(DATE(YEAR(TODAY()), 7, 1), "yyyy/MM/dd")  
    )   
    & " to "   
    & IF(MONTH(TODAY()) <= 6,   
        FORMAT(DATE(YEAR(TODAY()), MONTH(TODAY()), 1), "yyyy/MM/dd"),   
        FORMAT(DATE(YEAR(TODAY()) - 1, MONTH(TODAY()), 1), "yyyy/MM/dd")  
    ),  
    "Cost from "   
    & FORMAT(Parameters!FromDate.Value, "yyyy/MM/dd")   
    & " to "   
    & FORMAT(Parameters!ToDate.Value, "yyyy/MM/dd")  
)

 

Best Regards,

hackcrr

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you hackcrr for taking the time to respond.  I am sorry if I

did not mention the report is in Power BI Report builder and running your code I got this error:ISBLANK is not declared

MRad_0-1715608122041.png

 

 

Appreciate your help

MRad
Regular Visitor

Any chance anyone could shed more light on this, would very much appreciate it, still have not resolve it, thank you

 

Anonymous
Not applicable

Thanks for the reply from @hackcrr , allow me to provide a supplement to the approach you gave:
Hi,@MRad 

Regarding the issue you raised, my solution is as follows:

 According to the screenshot of your error report, the main reason is that the citation isbank function can not be called, the reason for this situation is because you use the function of DAX in powerquery, in Power Query M language, there is no direct ISBLANK function, but you can use other methods to determine whether it is empty or not:
1. Table.IsEmpty().To check if the table is empty, here is a simple output:

vlinyulumsft_0-1716282470080.png

Below are links to the relevant documentation:

 Table.IsEmpty - PowerQuery M | Microsoft Learn
2.List.IsEmpty().Checks if the column is empty, here is a simple output:

vlinyulumsft_1-1716282499727.png

Below are links to the relevant documentation:

List.IsEmpty - PowerQuery M | Microsoft Learn

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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