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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
slam
Frequent Visitor

Text to Percentage

Dear All,

Please help me to solve this problem.  There are including percentages( 0.96 ) and numbers (3100) in a column. So, i want to convert  percenatage 0.96 to 96%. Therefore, I add custum column with below formula.

if [Value] = null then null else if [Value]=">95%" then ">95%" else if [Value] <= 1 then Number.ToText([Value] * 100) & "%" else Number.ToText([Value])

The result is 

               From   to            

Screenshot 2023-05-22 093527.jpg

It is worked in some percentage but I have a problem in some results like 7.00000000007%, 55.00000000007 and 19.9.000000000%, 3.500000004%

 

Best Regards,

1 ACCEPTED SOLUTION
AjithPrasath
Resolver II
Resolver II

Please try the below code:

 

NewColumn =
IF (
ISBLANK ( [Value] ),
BLANK (),
IF (
[Value] = ">95%",
">95%",
IF (
[Value] <= 1,
FORMAT ( [Value] * 100, "0.00%" ),
FORMAT ( [Value], "0.00%" )
)
)
)

 

Best Regards,

Ajith Prasath

 

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

2 REPLIES 2
AjithPrasath
Resolver II
Resolver II

Please try the below code:

 

NewColumn =
IF (
ISBLANK ( [Value] ),
BLANK (),
IF (
[Value] = ">95%",
">95%",
IF (
[Value] <= 1,
FORMAT ( [Value] * 100, "0.00%" ),
FORMAT ( [Value], "0.00%" )
)
)
)

 

Best Regards,

Ajith Prasath

 

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

Thank you very much for your help!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors