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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
kinseld5
Helper II
Helper II

Reformat Field to Percent

hi

 

is it possible to reformat a field to be a percent, even if the value is alreday an integer number?

for example, if the data under 'percent' is 98, 97, 22, etc, and these values are actually the percentage values, how can i change this information to indicate percent, as changing the format to percent multiplies all of them by 100 and then turns into percent, i.e. 9800%, 9700%, 2200%. One option would be to make a new column and divide these values by 100 prior to formatting to percent but is there an easier way to do this?

 

br,

dave

1 ACCEPTED SOLUTION

Hi @kinseld5,

 

I get the whole idea now. If you don't want to add a new column, you have to divide the values by 100 first. 

1. Open Query Editor, apply "Replace values" once. Whatever the values are. We only need this step to generate some codes for us.

Reformat Field to Percent1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. Open "Advanced Editor". Replace the blue part with this:

each [Column1], each [Column1] / 100

Reformat Field to Percent2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. Change the Format to "Percentage".

Reformat Field to Percent3.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-jiascu-msft
Employee
Employee

@kinseld5,

 

Hi Dave,

 

I'm a little confused. Why not change the format directly?Reformat Field to Percent.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-jiascu-msft

Don't think you fully understand the question, changing to the percent format is simple but unfortunately the raw data is already showing as a percent, this was explained in the original post in better detail. If I just change the column to format percent i get 9800%, 5000%, even when I need it to read 98% and 50%

Hi @kinseld5,

 

I get the whole idea now. If you don't want to add a new column, you have to divide the values by 100 first. 

1. Open Query Editor, apply "Replace values" once. Whatever the values are. We only need this step to generate some codes for us.

Reformat Field to Percent1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. Open "Advanced Editor". Replace the blue part with this:

each [Column1], each [Column1] / 100

Reformat Field to Percent2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. Change the Format to "Percentage".

Reformat Field to Percent3.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thats brilliant Dale, thank you

Hi Dale,

When you say original query do you mean the query editor?
mow700
Resolver I
Resolver I

I would create a new column and probably use the FORMAT() function in conjunction with the calculation.

New Column = FORMAT([Original Column]/100,"Percent")

You could always transform this column in the original query as well.  If you never need this data as an int that's likely the best way to handle this.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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