Search code examples
powerbipowerbi-desktoppowerbi-embeddedpowerbi-datasourcepower-bi-report-server

Power BI :: Some credentials aren't validated as they are set to skip test connection


My problem is very easy: I'm retrieving all stocks about lithium on the ASX market from this web page.

I created a Power BI dashboard that you can visualize here.

As the source is Web I would like to refresh it every day using the Gateway connection, so I have successfully installed it on my computer that I turn on every day:

enter image description here

The problem is that instead of a successful daily refresh I have a daily error:

Failed to test the connection to your data source. Please retry your credentials.
Some credentials aren't validated as they are set to skip test connection.

enter image description here

If I enter in the Edit credentials I see the error: 
Failed to update data source credentials: The credentials provided for the Web source are invalid. (Source at https://www.marketindex.com.au/commodities/lithium.)Show details

This because I'm using Authentication method: Anonymous and Privacy level setting for this data source: Public. But this is exactly what I'm using on Power BI desktop and it's working!

enter image description here

What am I doing wrong here?

Why the same connection is working fine on Power BI Desktop but not the same dashboard uploaded online?

EDIT: the On-premises data gateway looks installed without problems

enter image description here


Solution

  • It seems like the issues you're experiencing may be caused by the link you're using (https://www.marketindex.com.au/commodities/lithium), although I'm not sure exactly why.

    For example, as has been mentioned in the Do I Need a Gateway for Web post, one can use Web.Contents instead of Web.BrowserContents in the raw M code in the Power Query Editor to avoid using a gateway. However, when I test this implementation using the link that you provide, I get an error when refreshing from Power BI online.

    There was an error when processing the data in the dataset.

    If I test this implementation using an HTML table from the https://tradingeconomics.com/commodity/lithium website, though, and set the data source credentials as follows, then I am able to successfully refresh the dataset from Power BI online.

    Data Source Credentials

    I tested this with another HTML table from a random webpage and an online refresh worked as well. So it seems like there is something odd about how Power BI online interacts with the Market Index website and this is causing your issue. Potentially because of some authentication configuration on the Market Index side of things? I'm not able to help with looking further into why this is occurring, though.

    Would you be able to use a different website with similar information as a data source for your report? If so, you could avoid the issues you're experiencing and avoid using a gateway in general if you wanted.

    If you go this route, it seems like using the included "Scheduled refresh" setup in Power BI online works, but I will include the Power Automate scheduled refresh setup below in case this is desired instead.

    Power Automate Scheduled Refresh

    One can use Power Automate to "schedule" dataset refreshes instead of the included "Scheduled refresh" functionality in Power BI online. The steps are a little too long to include here, but the Refresh your Power BI dataset using Microsoft Flow article outlines the process on setting this up. There are various triggers that you can use to trigger your flow. The linked article uses one that triggers based on a SharePoint action, but there is a Recurrence trigger that can be used to trigger your flow at regular intervals/times.

    Recurring Power BI Refresh

    Just set up your flow, make sure that it is "turned on", and your dataset will refresh at regular intervals from the cloud.