Forum Discussion
jaypatel
5 years agoHelper III
Split Number,StartDate and EndDate from string
Hi All, I have one string column which is the concatenation of the Number, StartDate and EndDate. I want to extract number, StartDate and EndDate from the string. Can Anyone help me out for this? ...
- 5 years ago
Hi jaypatel ,
Create 3 calculated columns as below:
First Value1 = var _search1=SEARCH("(",'Table'[Text],1,0) Return LEFT('Table'[Text],_search1-1)Start date = var _search1=SEARCH("(",'Table'[Text],1,0) Return MID('Table'[Text],_search1+1,10)End date = LEFT(RIGHT('Table'[Text],11),10)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Anonymous
5 years agoNot applicable
Hi jaypatel ,
I will not suggest you to do this in DAX.
However, these are the formulae you can try
First Value1 =
var _a = SUBSTITUTE('Table'[Text], "-","|",3)
var _b = SUBSTITUTE(_a,"(","|")
var _c = SUBSTITUTE(_b,")","")
RETURN
TRIM(PATHITEM(_c,1))
StDate =
var _a = SUBSTITUTE('Table'[Text], "-","|",3)
var _b = SUBSTITUTE(_a,"(","|")
var _c = SUBSTITUTE(_b,")","")
RETURN
TRIM(PATHITEM(_c,2))
StDate =
var _a = SUBSTITUTE('Table'[Text], "-","|",3)
var _b = SUBSTITUTE(_a,"(","|")
var _c = SUBSTITUTE(_b,")","")
RETURN
TRIM(PATHITEM(_c,3))
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
jaypatel
5 years agoHelper III
Anonymous
I have tried your formulas. But I only get the result from the First Value1 formula. Other 2 formulas are not responding as I expected. Could you please me.
Regards,
Jay
- Anonymous5 years agoNot applicable