Forum Discussion
Convert Percentage Type Column to Text Type and Preserve Percentage Format
- Anonymous1 year ago
Hi Linnil ,
Thank you for reaching out to the Microsoft Fabric Community.
you're correct that directly converting a Percentage column to Text in Power Query results in decimal values like 0.2 instead of retaining the "20.0%" format.
The solution shared by Vijay_A_Verma is correct as well. You can use the following transformation to convert the percentage to text while preserving the formatting:
= Table.TransformColumns(#"Changed Type", {"Data", each Number.ToText(_, "0.0%"), type text})This ensures values like 0.2 are displayed as "20.0%" in text format, making them usable with "Replace Values" and other text-based operations.
Alternatively, if you’d like to keep the original column and add a new formatted one, you can use:
= Table.AddColumn(#"Changed Type", "FormattedText", each Number.ToText([Data], "0.0%"), type text)I hope this will resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
Hi Linnil
When you convert a percentage column in Power Query, it’s actually stored as a decimal (e.g., 20% = 0.2). If you directly change the data type to Text, Power Query just shows that decimal (like “0.2”) instead of “20%”.
To keep the percentage format, you need to first scale the value and then change it to text. For example:
Text.From(Number.ToText([YourColumn] * 100) & "%")
This way, 0.2 becomes "20%", 0.142 becomes "14.2%", and so on.
Thank you for responding - this was a partial solution, I thought of this myself and added another step to get my end solution.