Forum Discussion
Extract url from text in DAX
Hi everyone
I'm trying to extract urls from twitter messages and placing in another column using DAX. I've been using this formula in excel to extract and it works fine:
=MID(A1,FIND("http",A1),IFERROR(FIND(" ",A1,FIND("http",A1))-1,LEN(A1))-FIND("http",A1)+1)
However I'm strugging to replicate/see how to do this in DAX. Any help greatly appreciated!
Thanks
Ben
Hi Matt and Baskar - I've followed your suggestion Matt and sorted the problem starting from Query Editor>Transform>Split Column>By Delimiter>Custom>"https".
Thanks again!
Cheers
Ben
10 Replies
- BaskarResident Rockstar
Hey pls give an a example . like screen short what u have and what u excatly want ..
like this, This will help me to solve ur prob
- MattAllingtonCommunity Champion
I agree, you need to post an example. But I also think this is a task for data shaping in power query (get data) and not DAX.
- Ben_NashFrequent Visitor
Hi
Thanks for getting back to me and good point on power query.
Screen grab of examples below - as you can see the urls aren't always in the same spot:
Thanks
Ben
- MattAllingtonCommunity Champion
How about using power query to split column on colon : then rebuild the URL http:// from there