Power BI: after exporting an excel file, percentage shows as number so to format it correctly

When I extracting a report from ServiceNow for instance, the percentage column shows as a number:

ServiceNow power bi
Excel power bi;

To remediate, there are 2 ways, changing it from excel directly or from Power BI. I will explain first from excel, although this topic is to explain you how to do it with Power BI but in case of.

First, format the column in %, then in another column, put this formula in the cell C2:

=A2/100

Duplicate it for the other cells and format this column in % without forgetting to show 2 decimals.

power bi

For Power BI, I have to go to the query editor first:

  • 1. Home -> transform data -> transform data
power bi
  • 2. Transform -> replace values
power bi
  • 3. In the popup, I put anything I like, I don’t care because I just want to get the code then click on “OK”
power bi power bi
  • 4. Home -> advanced editor
power bi
  • 5. Replace “123456,456789” by “each[argument],each[argument]/100” then click on “done”. NOTE: change "argument" by yours
power bi power bi

  • 6. Click on “close & apply”

If all go well, I get this view, so not yet the percentage I need:

power bi

To put it right:

  • 1. Select the column
  • 2. Column tools -> data type. Change “text” by “decimal number” and in format, select “percentage”
power bi power bi

And here it is the result:

power bi

Interesting Topics