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
Anonymous
Not applicable

Need Help in Data Formating

Hello,

 

I have a column that contains special character as well as middle space and number, i am looking to extract only number without getting any middle space in it.

 

Please help, i tried all method to get the same.

 

Suresh

1 ACCEPTED SOLUTION

Hi  @Anonymous ,

 

Because your data contains 2 types of data which causes such error,using below expression instead:

= Table.TransformColumnTypes(Table.AddColumn(#"Appended Query", "Custom", each Text.Select(Text.From([Column1]),{"0".."9"})),{{"Custom", Int64.Type}})

And you will see:

vkellymsft_0-1632191134961.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my raeply as a solution!

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

@Anonymous Well, in that particular case you could do:

Text.Replace(Text.Middle([Column1],1,10)," ","")

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Error New.JPG

 

Hi Sir,

 

My reference column is "Ref ID" from where i am trying you extract only number, however not able to go through form both solution i tried - "Solution 1" and "Solution 2".

 

Below which i tried...

=Text.Replace(Text.Middle([Ref ID],1,10)," ","")),

= Text.Select([Ref ID],{"0".."9"}))

 

Please help.

 

Thanks

Hi  @Anonymous ,

 

Because your data contains 2 types of data which causes such error,using below expression instead:

= Table.TransformColumnTypes(Table.AddColumn(#"Appended Query", "Custom", each Text.Select(Text.From([Column1]),{"0".."9"})),{{"Custom", Int64.Type}})

And you will see:

vkellymsft_0-1632191134961.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my raeply as a solution!

=Text.Remove(Text.From([Ref ID]??"")," ")

If you change [Ref ID] column type to text, it should work.

or

= Text.Select( Text.From ( [ #"Ref ID" ]) , {"0".."9"} )

Greg_Deckler
Super User
Super User

@Anonymous Sample data?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Sir, its like (0012345 78A. In this we have special character and albhabet as well as spacin between.

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