Forum Discussion
Return number value before "-" in string
Hi Experts
How would you return the number value in the following string (need the left numbers before the "-")
Column Result
0 - 1 week 0
52 - 53 week 52
1 - 6 week 1
6 - 7 week 6
Hi Anonymous ,
I used the formula you mentioned and get the correct result.
Not sure what error you have got by this formula.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
6 Replies
- Pragati11Super User
Hi Anonymous ,
You can get this transformed in Power Query easily.
I am taking the data as you shared above as follows:
Now select your column and from the top ribbon Transform --> Extract --> Text Before Delimiter
A new window appears, where enter your delimiter as "-" and then click OK
Finally you get the desired result:
Hope the solution helps.
- AnonymousNot applicable
Hi Pragati 11 - firstly, apologies - this has to be a calculated column... My fault.. I can do this the PQ way...
- AnonymousNot applicable
Hi - Have this but is noting working
Sort_Bands = LEFT('reporting Diagnostics_Weekly_Waiting_MDS'[Wait_Bands],FIND("-",'reporting Diagnostics_Weekly_Waiting_MDS'[Wait_Bands])-1)
- Pragati11Super User
Hi Anonymous ,
Let me know how it goes at your end with the solution I have provided above - which is the Power Query way 🙂
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
I used the formula you mentioned and get the correct result.
Not sure what error you have got by this formula.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team _ kalyj