Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Problems with decimals

Hi everyone,

 

I have a datum in format decimal(19,4) that comes from my database with SQL quering.

If I extract it in Power BI, in the data sheets, I obtain it correctly, as shown with 15 decimals.

 

 

But, when I use it in a visualization tool, either in a measure or directly, it changes:



This is a problem in a calculation that I made and that is shown in the replies

 

I know that Power BI uses float number, so this could be the problem...but, how can I solve it?

I tried CONVERT(FLOAT(53),("datum") in the SQL editor and the problem doesn't disappear.


Using a function like TRUNC/ROUND solves it but I cannot repeat this function in every measure, I'd like to have something more generic.

 

Any suggestion? Thanks.

 

3 Replies

  • Anonymous , You can set number of decimal place in column tools , once click on column in field list

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks amitchandak . 

      The problem is that this setting is visualization...but the data is always different
      I explain it better with an example:

      I made the sum in the red box, and it is quite zero

      ...but not exaclty zero!

       



      So... if I divide the number for this red box, I obtain the green box!

      Because Power BI divides a number for a "quite" zero...and the result is very big!


      If this were exaclty zero...I would have N/ 0 = 0
      instead... I have N / 0,000000000057 = 68937.....

       



  • Hi, Anonymous 

     

    Could you please consdier sharing a simple sample file without any sesentive information for further discussion?

    Then I can try to look into it and maybe get a specific solution for you.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng