Count hyperlinks in power bi

I have a column named "body" and in this columns there many rows that contain hyperlinks in text. enter image description here

is it possible in power bi to count if there is a hyperlink in text then create a new column that shows the number of hyperlink provided in the text or atleast show in a different column that this text contain hyperlinks. TA

Upvotes: 0

Views: 184

Answers (1)

Andrey Nikolov
Andrey Nikolov

Reputation: 13450

You can add a Custom Column to count the number of occurrences of <a (note there is a space after a) in the body. You can do that using Text.PositionOf function by passing Occurrence.All parameter, so the formula used to create the column should be something like this:

= List.Count(Text.PositionOf([body], "<a ", Occurrence.All))

This will give you how many times <a appears in the body (which is the number of hyperlinks):

enter image description here

Upvotes: 1

Related Questions