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:

let
  Source = Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, [UseReadOnlyReplica = null, AcceptLanguage = null, ODataMaxPageSize = null, Timeout = #duration(1, 0, 0, 0)]),
  #”Navigation 1″ = Source{[Name = “SANDBOXPBI”]}[Data],
  #”Navigation 2″ = #”Navigation 1″{[Name = “CRONUS USA, Inc.”]}[Data],
  #”Navigation 3″ = #”Navigation 2″{[Name = “Advanced”]}[Data],
  #”Navigation 4″ = #”Navigation 3″{[Name = “microsoft/reportsFinance/beta”]}[Data],
  #”Navigation 5″ = #”Navigation 4″{[Name = “customers”, Signature = “table”]}[Data]
in
  #”Navigation 5″

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.

2 Thoughts on “Quick Tip: Dataflows Error: The OData connector failed with the following error: We cannot convert the value null to type Duration.

  1. Jago Swiers on September 9, 2024 at 11:29 said:

    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

  2. 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!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post Navigation