Alberto Sueiro
Alberto Sueiro

Reputation: 90

Problems with decimals in PowerBI

I'm preparing some reports using PBI and while I was checking all data is correct, I've ran into some disparities between the database (SQL Server) and PBI data.

In my report I am calculating the sum of one column (price). In SQL Server the type of data is decimal(18,4). When i calculate the sum in SQL the results are different (like 0.4, nothing big) but i don't understand the data are not the same. In PBI the data type of that column is also a decimal with 4 digits after the point.

Messing a bit around with the total digits in PBI I've found some of the values are messed up. For example, a value could have 0.00000001 more or less than it is in the database. I'm not sure, but this could be my problem (the database has around 4 million rows, so this could lead to the 0.4 difference).

Am i doing something wrong? Is this a known error?

If you need more info just ask. Thank you all. I hope I've explain my problem clearly.

Upvotes: 0

Views: 1654

Answers (2)

GibbersSO
GibbersSO

Reputation: 1

I am also having this issue even if I converted it into DECIMAL(19,2) and MONEY. My guess is since SSMS is still in 32-bit while PowerBI is 64-bit.

Upvotes: 0

Alexis Olson
Alexis Olson

Reputation: 40264

I'm guessing this is a data type issue where Power BI is using floats versus the SQL decimal(18,4).

Try using the Fixed Decimal Number data type instead of the default Decimal Number.

Upvotes: 1

Related Questions