Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Decimal loss when loading from .xls file

Hi all,


Question

Using the folder import I am loading several .xls files of the same format. This all works well (aside from the fact that I have to open and save all .xls files separately without changing anything to the files, for Power BI not to give me the wrong key error. That however, is a matter for another time). Sadly, the two decimals present in the column 'transactieprijs per m2' of the .xls file are lost when loading them into Power BI dektop. 


Proposed solutions
Several solutions have been posted online regarding similar problems. These focus on two main problems:

  1. The Power BI query editor does not make the column of the correct type. This appears not to be the case as can be seen in the images. 
    https://community.powerbi.com/t5/Desktop/SOME-decimal-places-not-showing-in-data/m-p/529547
    https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?MessageKey=faa3a122-6c55-4ea4-9096-ef7b89c61725&CommunityKey=b35c8468-2fd8-4e1a-8429-322c39fe7110&tab=digestviewer 
    https://forum.enterprisedna.co/t/decimal-lost-in-power-bi-rounded-issue/21410 
    https://powerusers.microsoft.com/t5/Microsoft-Dataverse/Losing-number-of-decimal-places-in-power-query/td-p/858345 
  2. The column in the Excel file should be of the type 'number'. This is not the case, it is of the type 'custom'. However, the Excel file is the result of a standardized export. I'd like to find a way to solve this problem without having to change the type of the column within each of the Excel export files. 
    https://debug.to/740/import-decimal-numbers-from-excel-to-power-bi-without-approximated#:~:text=In%20Excel%20file%2C%20make%20sure,set%20to%20%22Decimal%20Number%22%20

Files

A photo of a trimmed down version of the .xls file is added to the question, which shows the original column together with its two decimals for each value. Would have liked to upload the original .xls file, but the file type is not supported in this question editor. Changing the file type to .xlsx for example, to be able to add the file to the question defeats the purpose since then the file type is different. Several other screenshots are added that show how Power BI Desktop interprets the column. The first figure before the type is changed, the second picture after the type is changed and finally how the data tab shows the column as it comes out of the query editor. 

 

Hope to hear from you, thanks in advance!

 

 

 

  • Try to avoid using .XLS files. If possible, use .XLSX or equivalent.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi all,

     

    Solved it by converting all files to .xlsx using an internet/cloud based solution, very simple and not costly. I did it this way because .xls is an old format that doesn't carry meta data very well, and I couldn't get the .xls file showing the deciamal files correctly.  

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi all,

     

    Solved it by converting all files to .xlsx using an internet/cloud based solution, very simple and not costly. I did it this way because .xls is an old format that doesn't carry meta data very well, and I couldn't get the .xls file showing the deciamal files correctly.  

  • Try to avoid using .XLS files. If possible, use .XLSX or equivalent.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ibendlin,

       

      Thankyou for your reply. Converting all files to .XLSX does seem to solve the issue. For other people with this question: this can be done easily and secured using online converter tools at little cost. 

       

      One question regarding your answer: why is .XLSX better than .XLS? I encounter .XLS files quite often so I thought it ought to be supported by Power BI right?

      Thanks!

      • lbendlin's avatar
        lbendlin
        Super User

        It's an ancient format that does not carry meta data well. It is not supported on the gateway or the Power BI service.