Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
7k views
in Power BI by 13 15 24

I have a decimal number in Excel and the format of cell in (number with two-digit decimal) and I want to import that numbers to the power bi but with the same value and without approximated.

Below is the screenshot from Excel 

The blow screenshot from power bi, notes the values is changed

So what is the trick to avoided the issue like this in the future?

Thank you


2 Answers

1 like 0 dislike
by 159 200 385
selected by
 
Best answer

Decimal data show as Integer in Power BI

If you have imported values from a database or excel sheet and the imported decimal values are showing as an integer values instead of decimal. so in this case, you should do the following:

How to import values with decimals in Power BI?

Steps

  1. In Excel file, make sure that the column format is "Number".

    Format decimal numbers in Excel

  2. In Power BI desktop, open "Query Editor" by clicking on the "Edit Queries".

    Edit Queries in Power BI

  3. in the Transform tab, click on the "Detect Data Type" button.

    Detect Data Type in Power BI

  4. Make sure that the "Data Type" is set to "Decimal Number".

    Change Data Type in Power Query in Power BI

  5. Close and Apply the changes.
  6. On the right side, at Fields, Click on the field name.
  7. In the Modeling tab, make sure that its data type and format are set to "Decimal Number".
  8. Adjust the decimal places as you prefer.

    decimal data show as an integer in Power BI


You might also like to read

0 like 0 dislike
by 13 15 24

In a case like this, We have to check 3 things

  1. Column Format in Excel should be "Number with decimal"
  2. Power BI "Query Editor" make sure the Data type is "Decimal Number"
  3. In Power BI in "Modeling" tab, make sure the Data type is "Whole Numer" and Format is "Decimal Number"

After that just refresh the data and everything should be OK.

by 159 200 385
0 0
Thanks, Mahmoud for sharing your valuable solution with the community, but I would like to add a bit note here, Changing data type again to the whole number is NOT required!
by
0 0
The above solution is not working for me.
I have got a column with No of hours but in some cases data is 1.5 for 1h and 30min. This decimals aren't shown by Power BI that only displays whole numbers in this column.
If you don’t ask, the answer is always NO!
...