Forum Discussion

SGuichon's avatar
SGuichon
Frequent Visitor
4 years ago
Solved

Power query - Number.round function works in Power BI Desktop, not in Power BI Services

Hi,

I use the function Number.Round in Power query. It works fine when used from Power BI Desktop

But when I try to refresh the report in Power BI Services (embedded licence), I get the following error :

 

Data source errorDataSource.Error: PostgreSQL : 42883: function round(double precision, integer) does not exist. DataSourceKind = PostgreSQL. DataSourcePath = ************. Message = 42883: function round(double precision, integer) does not exist. ErrorCode = -2147467259</pii>. . The exception was raised by the IDbCommand interface. Table: rejets

Here is my power query :

let Source = PostgreSQL.Database("*******************),
technique_job_reject = Source{[Schema="technique",Item="job_reject"]}[Data],
#"Filtered Rows1" = Table.SelectRows(technique_job_reject, each true),
#"Added Custom" = Table.AddColumn(#"Filtered Rows1", "Rounded RejectTime", each Number.Round(Number.From([reject_time])*24*60*60,0)/(24*60*60)),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Rounded RejectTime", type datetime}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"reject_time"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Rounded RejectTime", "Date rejet"}})
in #"Renamed Columns"

 

Can someone help me ?

  • Hi SGuichon ,

    When I tested with the same query like yours, I got the same error in Power Query Editor:

    Try to edit this query when adding the custom column:

    #"Added Custom" = Table.AddColumn(#"Filtered Rows1", "Rounded RejectTime", each Number.Round(Number.From([reject_time])*24*60*60)/(24*60*60)),

    It should work:

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

2 Replies

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi SGuichon ,

    When I tested with the same query like yours, I got the same error in Power Query Editor:

    Try to edit this query when adding the custom column:

    #"Added Custom" = Table.AddColumn(#"Filtered Rows1", "Rounded RejectTime", each Number.Round(Number.From([reject_time])*24*60*60)/(24*60*60)),

    It should work:

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

  • SGuichon's avatar
    SGuichon
    Frequent Visitor

    v-yingjl , thank you very much
    the ",0" in the Round.Number function created a failure in Power BI services but not in Power my BI Desktop.

    After removing it, the refresh works fine in any way.

    Best regards,

    SGuichon