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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
gordgord1
Regular Visitor

Help, Stuck with Text Column (How to display decimal as a percentage?)

Hello, 

Dealing with people who mixes data types. Causing a hassle for me.
Need to call in someone smarter than me. 
Stuck using a text column. Most people want to see percentages in this format 75% not 0.75.

 

ColumnA (Text)New Column (Text)
 blank
00
0.050.05
0.3031914890.303191489
0.3333333330.333333333
11
N/AN/A

 

New Column = SWITCH (

    TRUE (),

    DataSource[ColumnA] = "N/A", "N/A",

    ISBLANK[DataSource[ColumnA]) = TRUE, "blank",

    ISBLANK(DataSource[ColumnA]) <> TRUE, FORMAT(DataSource[ColumnA],"Percent"), "otherwise")

 

(Note: inserted word "Blank", just to confirm that portion was working).

 

I also tried. ISBLANK(StackFEDEDVPData[% with DV Requests]) <> TRUE, FORMAT ( StackFEDEDVPData[% with DV Requests], "#.00%" ).

Nothing I do is working. Don't know if hitting tool limitations. Thanks in advance. 

Kevin

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @gordgord1 

 

Download example PBIX file with the code below

 

Do you need to keep the N/A ?

 

Wouldn't getting rid of text and making the column numeric be more useful for further analysis and calculation?

 

Use this to create the column

 

Column = 

SWITCH( TRUE(),

[ColumnA (Text)] = "N/A", BLANK(),

[ColumnA (Text)] = "", BLANK(),

VALUE([ColumnA (Text)]
))

 

Then format the column as Percentage

 

PhilipTreacy_0-1764113355588.png

 

Or if you want a measure

 

Measure = 

VAR _value = SELECTEDVALUE(Data[ColumnA (Text)])

RETURN 

SWITCH( TRUE(),

_value = "N/A", BLANK(),

_value = "", BLANK(),

VALUE(_value)
)

 

Format the measure as a Percentage.

 

 

If you want to keep the column as text then use this

 

Column 2 = 

SWITCH( TRUE(),

IFERROR(VALUE([ColumnA (Text)]), TRUE()), [ColumnA (Text)],

FORMAT(VALUE([ColumnA (Text)]), "0.00%")

)

 

PhilipTreacy_1-1764114148188.png

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
gordgord1
Regular Visitor

@PhilipTreacy  I work with engineers, not data scientists. Stuck with what is being handed to me. Hence, mixed data in a column. For sake of simplicity, backed off desired format. Not worth the effort or complexity. Just used a formula to standardize the data in the text column so decimal places were no longer variable. 🙂


Prefer not to needlessly complex formula. 

Cleaned Up Column = LEFT(DataSource[MyColumnName],4).
Employed a different tactic for color background. Some days not worth the effort fighting a poor data structure.
 
gordgord1_0-1764129526496.png

Closing Request for Help.

PhilipTreacy
Super User
Super User

Hi @gordgord1 

 

Download example PBIX file with the code below

 

Do you need to keep the N/A ?

 

Wouldn't getting rid of text and making the column numeric be more useful for further analysis and calculation?

 

Use this to create the column

 

Column = 

SWITCH( TRUE(),

[ColumnA (Text)] = "N/A", BLANK(),

[ColumnA (Text)] = "", BLANK(),

VALUE([ColumnA (Text)]
))

 

Then format the column as Percentage

 

PhilipTreacy_0-1764113355588.png

 

Or if you want a measure

 

Measure = 

VAR _value = SELECTEDVALUE(Data[ColumnA (Text)])

RETURN 

SWITCH( TRUE(),

_value = "N/A", BLANK(),

_value = "", BLANK(),

VALUE(_value)
)

 

Format the measure as a Percentage.

 

 

If you want to keep the column as text then use this

 

Column 2 = 

SWITCH( TRUE(),

IFERROR(VALUE([ColumnA (Text)]), TRUE()), [ColumnA (Text)],

FORMAT(VALUE([ColumnA (Text)]), "0.00%")

)

 

PhilipTreacy_1-1764114148188.png

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


gordgord1
Regular Visitor

@Idrissshatila Thanks I will give a try. Almost inclined to say deal with the numbers as is for sake of simplicity.

Idrissshatila
Super User
Super User

Hello @gordgord1 ,

 

check if the following works for you 

Idrissshatila_0-1764102972344.png

Formatted Percentage Column = 
VAR txt = TRIM( 'Table (2)'[ColumnA (Text)] )
VAR txtClean = SUBSTITUTE(txt, ",", ".")
VAR numFromPercent =
    IF(
        CONTAINSSTRING(txtClean, "%"),
        IFERROR( VALUE( SUBSTITUTE(txtClean, "%", "" ) ) / 100, BLANK() ),
        BLANK()
    )
VAR numFromValue = IFERROR( VALUE(txtClean), BLANK() )
VAR num = COALESCE( numFromValue, numFromPercent )
RETURN
IF(
    ISBLANK(num),
    txt,
    FORMAT(num, "0.00%")
)


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.