Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Cannot convert the literal to the expected type 'Edm.Decimal'

Hi!

I’m building a PowerBI report using data from Azure DevOps OData.

Here is the query:

 

let
Source = OData.Feed (https://analytics.dev.azure.com/{org}/{proj}/_odata/v3.0-preview/WorkItems?
& "$apply=filter("
& "State eq 'Done'"
& "and startswith(Area/AreaPath,'somearea\subarea')"
& "and (WorkItemType eq 'Support Request' or WorkItemType eq 'Product Backlog Item')"
& ")"
& "/compute(year(CreatedDate) as Year, month(CreatedDate) as Month)"
& "/groupby ("
& "(Area/AreaPath, WorkItemType, Year, Month),"
& "aggregate (CycleTimeDays with average as CycleTimeAvg, LeadTimeDays with average as LeadTimeAvg)"
& ")"
,null, [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4])
in
Source

 

 

OData URL works fine from the browser window - it returns all expected data.

But running this query from PowerBI Desktop resuls in error on one of the records:

 

DataSource.Error: OData: Cannot convert the literal '8.675E-06' to the expected type 'Edm.Decimal'.
Details:
    DataSourceKind=OData
    DataSourcePath=https://analytics.dev.azure.com/{org}/{proj}/_odata/v3.0-preview/WorkItems

 

 

Here is the raw data returned by OData endpoint:

 

{"@odata.id":null,"Month":8,"Year":2020,"WorkItemType":"Product Backlog Item","LeadTimeAvg":3.762890575,"CycleTimeAvg":8.675E-06,"Area":{"@odata.id":null,"AreaPath":"somearea"}}

 

 

Obviousely, PowerBI Desktop fails to interpred this value: "CycleTimeAvg":8.675E-06

Anybody knows how to fix that?

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Maybe I'm missing something but how does the articele about type conversions issue in Power Apps component framework relates to type conversion issue in Power Query OData Feed connector?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Afaik it is still not fixed in PBI.
      As a workaround try to filter the results so PBI won't receive too small values in data. Like CycleTimeAvg > 0.05.