Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cjngct1112
Frequent Visitor

How to add "%" to values

Hi all,

I have a table like this (but > 40 columns)

ABCDEF........
AAAB0.280.680.990.41
BBBC0.830.130.200.53
CCCD0.560.240.090.45
DDDE0.680.350.240.90
EEEF0.030.550.730.39

 

I would like to add "%" on all values except the first 2 columns like this.

How to transform in Power Query with a efficient query?

ABCDEF
AAAB0.28%0.68%0.99%0.41%
BBBC0.83%0.13%0.2%0.53%
CCCD0.56%0.24%0.09%0.45%
DDDE0.68%0.35%0.24%0.9%
EEEF0.03%0.55%0.73%

0.39%

 

Thanks in advance

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls see my video
https://1drv.ms/v/s!AiUZ0Ws7G26RiBgWRs6CITvMH5Hh?e=I1N5iV
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RiBeh65zx6Lo9gcL6?e=KLxt9B

= Table.TransformColumns(from,
         List.Transform(
              List.Skip( Table.ColumnNames(from),2),(i)=> {i,(x)=> 
         Text.Insert(Text.From(x),Text.Length(Text.From(x))
," %"),
       type text}))

View solution in original post

6 REPLIES 6
Ahmedx
Super User
Super User

pls see my video
https://1drv.ms/v/s!AiUZ0Ws7G26RiBgWRs6CITvMH5Hh?e=I1N5iV
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RiBeh65zx6Lo9gcL6?e=KLxt9B

= Table.TransformColumns(from,
         List.Transform(
              List.Skip( Table.ColumnNames(from),2),(i)=> {i,(x)=> 
         Text.Insert(Text.From(x),Text.Length(Text.From(x))
," %"),
       type text}))

@Ahmedx , the script is working on my case and really brilliant

Thanks so much!

shmmini
Frequent Visitor

Hi @cjngct1112 

you can add the format function to your measure to format it like this 

Measure = FORMAT(Your Calculation or a reference to a measure , "#\%"). Pay attention to the \. If you forget it, the value will be transformed to a %, which seems not what you want
If your formatting requirement is more complex, you can use Calculation Groups for Dynamic format string
 
another alternative could be simply dividing your results by 100 and converting the measure to a percentage in the measure formatting ribbon
I hope this helps
cjngct1112
Frequent Visitor

@danextian , after I change the datatype to "percetage", it will auto devide by 100. not achieve the desired result

danextian
Super User
Super User

Hi @cjngct1112 ,

 

You can change the data type in Power Query but they will still be loaded as decimal numbers in the designer. In the designer, you have to select each column and change the formatting to percentage.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

So you want to just add % after each number and for 40 columns?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.