Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
Solved! Go to 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.
2. Open "Advanced Editor". Replace the blue part with this:
each [Column1], each [Column1] / 100
3. Change the Format to "Percentage".
Best Regards!
Dale
Hi Dave,
I'm a little confused. Why not change the format directly?
Best Regards!
Dale
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.
2. Open "Advanced Editor". Replace the blue part with this:
each [Column1], each [Column1] / 100
3. Change the Format to "Percentage".
Best Regards!
Dale
Thats brilliant Dale, thank you
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.
User | Count |
---|---|
102 | |
90 | |
80 | |
71 | |
70 |
User | Count |
---|---|
114 | |
99 | |
97 | |
73 | |
72 |