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 | |
Excel | ; |
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.
For Power BI, I have to go to the query editor first:
- 1. Home -> transform data -> transform data
- 2. Transform -> replace values
- 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”
- 4. Home -> advanced editor
- 5. Replace “123456,456789” by “each[argument],each[argument]/100” then click on “done”. NOTE: change "argument" by yours
- 6. Click on “close & apply”
If all go well, I get this view, so not yet the percentage I need:
To put it right:
- 1. Select the column
- 2. Column tools -> data type. Change “text” by “decimal number” and in format, select “percentage”
And here it is the result:
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...