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
Matt22365
Resolver III
Resolver III

Seperate numbers from text - custom column

Hi all

 

I would like to seperate some numbers from text in my source data (sharepoint task list). 

 

I have a column which represents work and the data is entered as 1 hr (this is so the resource can be captured in MS Project so the data entry cannot be changed)

However when this comes across to power BI it recognises it as text. I would like to extract the 1 from the hr so BI understands it as a number.

 

I found a way to do this on a blog using the formula: =Text.Select([Work],{"0".."9"}) as a custom column in query editor. This works great for whole numbers but not for decimals. e.g. 0.7 hrs => 7. Does anyone know how to adjust the formula to account for decimals?

 

As reference, the blog can be found here - https://eriksvensen.wordpress.com/2018/03/06/extraction-of-number-or-text-from-a-column-with-both-te...

 

Thanks

 

Matt 

1 ACCEPTED SOLUTION
petrovnikitamai
Resolver V
Resolver V

try to add point in select

Text.Select([hz_che_eto],{"0".."9","."})

image.png 

View solution in original post

2 REPLIES 2
petrovnikitamai
Resolver V
Resolver V

try to add point in select

Text.Select([hz_che_eto],{"0".."9","."})

image.png 

Fantastic, that worked great, thank you

 

Matt 

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.