cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Matt22365 Member
Member

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

Accepted Solutions

Re: Seperate numbers from text - custom column

try to add point in select

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

image.png 

2 REPLIES 2

Re: Seperate numbers from text - custom column

try to add point in select

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

image.png 

Matt22365 Member
Member

Re: Seperate numbers from text - custom column

Fantastic, that worked great, thank you

 

Matt