Forum Discussion

Linnil's avatar
Linnil
Helper III
1 year ago
Solved

Convert Percentage Type Column to Text Type and Preserve Percentage Format

Hi Everyone   I have various percentages in a list ie 20.0%, 14.5%, 36.7% etc. One decimal place.   I want to change the Data Type from Percentage to Text, so I still see  20.0%, 14.5%, 36.7% B...
  • Anonymous's avatar
    Anonymous
    1 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.