top of page

How to avoid having to use a personal gateway for web data sources (html page or table) in Power BI

When you import publicly available data into your report you will most likely use the web connector in Power Query.

This might lead to issues later on when trying to refresh your dataset.


Here is why:


ree

When you select the Web connector in Power BI (or Power Query) to load publicly accessible data (with anonymous authentication)







This function will be automatically created:

= Web.BrowserContents("MYURL")


This will lead to issues when you publish your report to the Power BI Service and try to refresh it.



ree

As you can see, the gateway connection option is on and data source credentials is greyed out in the Power BI service.


This means you can only refresh your data after installing a personal gateway on your machine and we do not want that.





So what can be done?


Well it is pretty easy, manually change the function to:


= Web.Contents("MYURL")


Now, when you publish your report you will see the following:


ree

Power BI tells us this is a public data source and it does not need a personal gateway.




ree




Now we can also set our data source credentials with the correct authentication method and privacy level.



Conclusion


Replace the default function created by the web connector Web.BrowserContents with Web.Contents as outlined above.


Microsoft's documentation states that:

Web.BrowserContents "Returns the HTML for the specified url, as viewed by a web browser."

whereas

Web.Contents "Returns the contents downloaded from url as binary"


If you have had trouble with this feel free to comment and share your thoughts.

8 Kommentare


Radka Jánská
Radka Jánská
25. Apr. 2021

Hallo, thanks for interesting tip. I have the same problem with odata. Do you have any trick what to do in this case?

Gefällt mir
Brunner_BI
Brunner_BI
08. Aug. 2021
Antwort an

Sorry for the late reply but your odata feed is requiring a gateway? Is the data on the web?

Gefällt mir

Mark Lobbezoo
Mark Lobbezoo
23. März 2021

Thanks this works perfectly, a tip for when you try this. When you open the settings of your dataset, have a bit of patience it can take a few moments before you can see the data source credentials. also if you don't see the source credentials you can click on the gateway then it will show you the source credentials

Gefällt mir

Gijzette Strickland
Gijzette Strickland
17. März 2021

Hi, It is an internal website. That houses statistical data. I am able to pull via PowerBi desktop using anonymous credentials.

Gefällt mir
Gijzette Strickland
Gijzette Strickland
17. März 2021
Antwort an

Yes, that’s exactly what I mean. I think my management and I were under the impression that it didn’t matter.


I’ll pull the data into a spreadsheet placed on SharePoint and pull it from there.

Thank you so much for replying.

Gefällt mir

Brunner_BI
Brunner_BI
17. März 2021

Hi Gijzette, what is your data source?

Gefällt mir

Gijzette Strickland
Gijzette Strickland
17. März 2021

When I choose Get Data > Web PowerBi automatically selects Web.Contents. According to the PowerBi Service I need a gateway. Which as you said is not a viable option.

Gefällt mir
bottom of page