Forum Discussion
Handling Large Decimal Values
I have a column in MSSQL that's decimal(28,9) and used as a primary key. As I understand it Power BI's own decimal type is equivalent to decimal(19,4). I've determined that there are rows in this table that use the full 9 digits of scale. I need to perform merges on this column. What is the best way of making sure there isn't any rounding performed?
2 Replies
- daxCommunity Support
Hi foo,
As I know, powerbi seems only support 15 decimals, when your decimal is over 15, it will automatically cut off and round up, this is by design. If your decimal is less than 15, you could set formatting like below to keep original data
By the way, I suggest you could post this requirement in power-bi-ideas
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- fooFrequent Visitor
I doubt they're going to implement large decimal values just for me :catsad:. The application I'm working with is a bit of an oddball and I don't expect many people to have this problem. If Fixed Decimal Number only supports decimal(19,4) changing the formatting won't help. Doesn't changing the formatting only affect how digits are displayed? The merges are in Power Query M so the fix has to be in Power Query M. As for the Decimal Number type that's an 8-byte floating point and floating points are potentially rounded. The documentation even says it's the equivalent of Excel's number type and that's IEEE 754 floating point. I was thinking about converting the number to a string but I am not sure if that will retain the accuracy. If Power Query M has to process the field as a Fixed Decimal Number before conversion to the text type it will be truncated.