cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Wise1
Helper I
Helper I

Extract URL of hyperlink text - Suggestions

 

Hello All, 

 

I have been trying to find info on how to extract a "URL" of column data which Power Bi has imported off a website table that has clickable links in it. 

ie:  https://www.extendoffice.com/documents/excel/859-excel-list-hyperlinks.htm

 

The main aim is to have the URL exported and placed into another column and maintain the origional cell data. 

ie: 

 

ColumnData (From website)      |       URL Data

google (<--- URL)                      |    www.google.com.au

 

if google had a href url enabled as part of its data, can i have both the URL and the name "google" imported into PowerBi Desktop? 

 

 

 

Any pointers are greatly welcome! 

 

Thanks!

 

3 REPLIES 3
v-yulgu-msft
Microsoft
Microsoft

Hi @Wise1,

 

Take this link https://www.extendoffice.com/documents/excel/859-excel-list-hyperlinks.htm as an example, your expect result is displaying "www.extendoffice.com" and "extendoffice" in two new columns, right?

 

Below is my test. I created a table named "URL" containing one column [ColumnData]. Then, I created two calculated columns based on [ColumnData].

 

URLData =
MID (
    'URL'[ColumnData],
    FIND ( "http://", 'URL'[ColumnData] ) + 7,
    FIND (
        "/",
        MID (
            'URL'[ColumnData],
            FIND ( "http://", 'URL'[ColumnData] ) + 7,
            LEN ( 'URL'[ColumnData] ) - 7
        )
    )
        - 1
)

URLName =
MID (
    MID (
        'URL'[URLData],
        FIND ( ".", 'URL'[URLData], 1 ) + 1,
        LEN ( 'URL'[URLData] ) - FIND ( ".", 'URL'[URLData], 1 )
    ),
    1,
    FIND (
        ".",
        MID (
            'URL'[URLData],
            FIND ( ".", 'URL'[URLData], 1 ) + 1,
            LEN ( 'URL'[URLData] ) - FIND ( ".", 'URL'[URLData], 1 )
        ),
        1
    )
        - 1
)

 

3.PNG

 

Alternatively, you can directly split this column into multiple columns then delete unnecessary columns. Go to Editor>Transform>Split Column>By Delimiter>Custom>"/". Reference: Extract url from text in DAX

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Yuliana Gu,

 

I have a similar scenario wherein i need to extract all the links from a given mail body. Right now i am able to extract only the first link or only link. Is there any possiblity to extract all the links and store it in a column.

 

Any help would be greatly appreciated.

 

Thanks

Danish

Sorry i have not written back yet, i have been under the pump with Xmas coming up 

- Thanks for taking the time to reply 

 

i will have a look at this as soon as i can and let you know! 

 

Thanks again for all the pointers and info and i will let you know asap !

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors