When you create a Power BI Dataflow with the Business Central connector, you might get the following error:
The OData connector failed with the following error: We cannot convert the value null to type Duration.
The error mentions a conversion of null into a type Duration. This got me thinking.
Let’s have a look at the code by selecting Show Details:
section Section1;
shared Query = let
Source = Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, [UseReadOnlyReplica = null, AcceptLanguage = null, Timeout = null, ODataMaxPageSize = null])
in
Source;
So the Dynamics365BusinessCentral.ApiContentsWithOptions() takes a few parameters and one of them is a date: Timeout. This is probably the cause.
Go back and open the Advanced options:
Here you find the Odata Timeout parameter, which by default is empty.
Add a value in it and then try again.
and voila, it’s working again.
To me this looks like a bug, because in the past it would work out of the box.
When I open the Advanced Editor, I can see this:
I did not find any documentation about the Timeout parameter, but apparently for Power BI Dataflows it can not be zero.
The strange thing is that when I do exactly the same in Power BI Desktop, it does not give any error:
So it must be a bug and will probably be fixed soon, and if you encounter it, now you know how to work around it 😉
Discover more from think about IT
Subscribe to get the latest posts sent to your email.
I’ve had the same issue today, except with an other table. See this post for more info.
https://community.fabric.microsoft.com/t5/Service/undefinedPower-BI-error-NULL/m-p/4131975
Hi,
Since 09/09/24 I had the same issue with the BC connector (webservices) in my semantic model.
A lokal refresh in Power BI desktop works fine, but the refresh in the Power BI service failed.
I replaced all my BC sources to
Source = Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, [UseReadOnlyReplica = null, AcceptLanguage = null, ODataMaxPageSize = null, Timeout = #duration(1, 0, 0, 0)])
and it works 🙂
thanks!