Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
Solved! Go to Solution.
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:
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:
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.
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
Appreciate your help
Any chance anyone could shed more light on this, would very much appreciate it, still have not resolve it, thank you
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:
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:
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |