Decimal Precision in Power Query

  • Decimal Precision in Power Query

    Posted by DSC Communities on April 5, 2021 at 5:58 pm
    • Mike Kromminga

      Member

      April 5, 2021 at 5:58 PM

      I’m building a dataflow and because of some weird header data, have to bring in all fields as text and change the type in later steps. I have Lat/Long fields with 15 digit precision, but after changing the data type to decimal number, it strips the precision and is only storing 3 digits. I don’t don’t see any spot to update and keep all the digits. Normally I wouldn’t be upset about lower precision, but with Lat/Long I’d prefer at least 5.Ā 
      Any ideas of additional M code I can add to specify precision before/after/during the data type change from text to decimal? Screen shots attached.

      ——————————
      Mike Kromminga
      Data Architect | ITA Group
      ——————————

    • Ben Howard

      Member

      April 6, 2021 at 9:05 AM

      Hi Mike,

      I am not seeing the same issue as you, the precision is persisted from the source file, in this case it’s a .csv file.Ā Ā 

      ——————————
      Ben Howard, UK.

      Please mark any answer as recommended if it helps you.
      ——————————
      ——————————————-

    • Mike Kromminga

      Member

      April 6, 2021 at 2:16 PM

      Continued playing around with this and tried in PBI desktop as well. In Power Query/dataflow it looks like it removes precision but it actually does retain all digits. Desktop and dataflows are slightly different in how many digits they show in the editor. But once you load the model, in the data/table view in desktop you can specify the number of decimal places to show and all are available in the report view.
      Turns out it wasn’t really an issue but since I haven’t moved beyond modeling yet I didn’t realize it.

      ——————————
      Mike Kromminga
      Data Architect | ITA Group
      ——————————
      ——————————————-

    • Rick De groot

      Member

      January 29, 2023 at 7:08 AM

      Mike,

      In case you bump into precision issues, it’s good to know Power Query by default uses the Double Precision Floating Point.Ā 

      In case that does not give you enough detail you can change it around to the Decimal.Precision floating point using the Precision Type. More on this you can read here:Ā 
      Power Query Precision: Avoid Rounding Errors – BI Gorilla

      ——————————
      Rick De groot

      Advance with Excel and Power BI:
      https://Gorilla.bi

      BI Gorilla

      https://youtube.com/BIGorilla
      ——————————
      ——————————————-

    DSC Communities replied 4 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Decimal Precision in Power Query’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!