Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Martin_MG
Frequent Visitor

Web page word counting

I am using power query through power bi to connect to a web page. yahoo.com in general, could be other pages also. I wanted to count how many times "Covid" appeared on a page. I tried using the web connector and looking at several blog. Couldnt figure it out. Any help is appreciated. 

2 REPLIES 2
Fowmy
Super User
Super User

@Martin_MG 

I tried it and it worked for me. Connected to this page https://docs.microsoft.com/en-us/power-bi/guidance/whitepaper-powerbi-security

from Power Query and counted the word "Power BI", it appears 306 times. I added a column and counted the occurrences of the word. Paste the below code in a blank query and replace the link and the search word.

let
    Source = Web.BrowserContents("https://docs.microsoft.com/en-us/power-bi/guidance/whitepaper-powerbi-security"),
    #"Converted to Table" = #table(1, {{Source}}),
    #"Added Custom1" = Table.AddColumn(#"Converted to Table", "Custom.1", each List.Count(Text.PositionOf([Column1],"Power BI",Occurrence.All )))
in
    #"Added Custom1"

Fowmy_0-1601326004775.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I got the same results on the microsoft site. I have been tring the (Web.BrowserContents("https://www.yahoo.com/") on yahoo. With Failed results. attaching photos. When you web connect /  add tables using examples, this show that there are multiple refrences of covid on the page. If you use the query you supplied the query only returns a value of 1. Some pages it works and some it does not?Web connect word search.pngWeb covid 1.png

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.