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.