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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
karstenhilton
New Member

Trying to remove characters from field

Hello everyone. I am new to the forum. I have been working in Power BI for about 6 months and really starting to get into the deeper end of the pool here. 

I have looked through the forums and not quite finding what I am looking for and hoping you all can help. Here is the issue.

 

I have a field that has something like this in it. 

USD $15,000.00/Yr.

What I am trying to achieve is this.

15000.00

I have create a new custom column using this below

=Text.Select(
[DATA],
Text.ToList(
Text.Select(
[DATA],
{"0".."9","."}

)
)
)

 

The result I get is this.

15000.00.

 

I am trying to get rid of the . at the end. 

I have tried to use, Text.Start([DATA];Text.Length([DATA])-1), but it just errors out the data in the new column.

Appreciate any help and guidance on this.

1 ACCEPTED SOLUTION
Duia
Resolver II
Resolver II

Hi @karstenhilton ,
Here are the steps you can follow:
There are two methods here:
Method 1:
1. Create calculated column.

 

Column =
var _1=
VALUE(
MID(
'Table'[USD],
2,6))
return
FORMAT(_1,"Fixed")

 

Result:

Duia_0-1660032112139.png

But the format is Text, because the results obtained by using the Format function are in Text format
https://docs.microsoft.com/en-us/dax/format-function-dax

Method 2:
1. Create calculated column.

 

Value =
VALUE(
MID(
'Table'[USD],
2,6))

 

2. Click on the newly created new column, select Column tools - 2 - the value will have two decimal points
This is the numeric format

Duia_1-1660031641413.png

If you need pbix, please click here.

Trying to remove characters from field.pbix

 

Best Regards,
Liu Yang
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
Duia
Resolver II
Resolver II

Hi @karstenhilton ,
Here are the steps you can follow:
There are two methods here:
Method 1:
1. Create calculated column.

 

Column =
var _1=
VALUE(
MID(
'Table'[USD],
2,6))
return
FORMAT(_1,"Fixed")

 

Result:

Duia_0-1660032112139.png

But the format is Text, because the results obtained by using the Format function are in Text format
https://docs.microsoft.com/en-us/dax/format-function-dax

Method 2:
1. Create calculated column.

 

Value =
VALUE(
MID(
'Table'[USD],
2,6))

 

2. Click on the newly created new column, select Column tools - 2 - the value will have two decimal points
This is the numeric format

Duia_1-1660031641413.png

If you need pbix, please click here.

Trying to remove characters from field.pbix

 

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

karstenhilton
New Member

I have tried a modified version of what I found on this forum.

https://community.powerbi.com/t5/Service/Removing-the-last-character-from-text-data/m-p/102402#M1697...

 

Seems to give me what I am trying to do, but would still like any suggestions in case there is another way that may be a best practice if this one is not.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.