Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SGuichon
Frequent Visitor

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 ?

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @SGuichon ,

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

vyingjl_0-1651459621628.png

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:

vyingjl_1-1651459709459.png

 

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.

 

 

View solution in original post

2 REPLIES 2
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 

v-yingjl
Community Support
Community Support

Hi @SGuichon ,

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

vyingjl_0-1651459621628.png

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:

vyingjl_1-1651459709459.png

 

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.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors