Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Is there a work around for this Cannot convert literal to 'Edm.Decimal error

I keep getting this error when I try to connect to table in Power BI via OData connector.  when I remove fields with decimals from the table the error goes away but when I add them back I get the below, 

Error: Data Source Error : DataSource.Error: OData: Cannot convert the literal '4.34434343545435E+16' to the expected type 'Edm.Decimal'. DataSourceKind = <ccon>OData</ccon> DataSourcePath = <ccon>

 

I need decimals fields. Is there a work around?  or way to fix issue?

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    According to the error message, it seems to be a data type convert error. Could you please provide some sample data in the decimal field for the further troubleshooting? And you can try to follow the steps below to do it and check if you can get the table successfully...

    1.  Disable data type auto detection feature as below screenshot

    2. Change the data type of the decimal field with the proper data type

     

    In addition, you can refer the following threads which have the similar problem as yours to get it.

    Data type Error

    Table.TransformColumnTypes(Table6_Table,{{"Numbers", type any}})

     

    Instead of "type text" as per above syntax use "type any" then problem should be solved

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

    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.

    Best Regards

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    There was a number field that had test data that was larger than the limit 16 digits.  I updated data in application and added a url filter to limit records over 16digits. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

      Thanks for sharing the solution here. It will help the others in the community find the solution easily if they face the similar problem as yours. Thank you.

      Best Regards

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    According to the error message, it seems to be a data type convert error. Could you please provide some sample data in the decimal field for the further troubleshooting? And you can try to follow the steps below to do it and check if you can get the table successfully...

    1.  Disable data type auto detection feature as below screenshot

    2. Change the data type of the decimal field with the proper data type

     

    In addition, you can refer the following threads which have the similar problem as yours to get it.

    Data type Error

    Table.TransformColumnTypes(Table6_Table,{{"Numbers", type any}})

     

    Instead of "type text" as per above syntax use "type any" then problem should be solved

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

    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.

    Best Regards