Search code examples
apipowerbipowerbi-desktopheremapshere-maps-rest

HERE Geocoding API and PowerBI


I'm kind of new in this API world.

I'm facing some issues with Here Maps API and PowerBi scheduled refreshes. Below is how I made my API which does works in PowerBI Desktop

Here Maps API in PowerBI

I've tried to use the function RelativePath in PowerBi but I have another issue lol. When I isolate the API link, this is the message I get:

HERE API Link error

Does anybody knows how I can make this work? Here is the main link: https://geocode.search.hereapi.com/v1/geocode?q=Invalidenstr+117+Berlin&apiKey={YOUR_API_KEY}

Below PowerBI Service error (it in Brazilian Portuguese and here is the Google translation: This dataset includes a dynamic data source. Since dynamic data sources are not refreshed in the Power BI service, this dataset will be refreshed. Learn more: https://aka.ms/dynamic-data-sources. Data source for Query1)

PowerBI Error


Solution

  • You need to split the base Url from the RelativePath in order to refresh in the service. The credentials apply to the base Url, and so the saved credentials can't be used when you change the base Url at runtime.

    And you shouldn't put your Api Key in the Url at all (base Url, RelativePath, or Query). Instead you tell PQ where to plug it in, and configure the API Key in your Data Source security. So the Power Query should look something like this:

    let
        Url = "https://geocode.search.hereapi.com",
        rp = "/v1/geocode?q=Invalidenstr+117+Berlin",
        Source = Json.Document(Web.Contents(Url, [RelativePath=rp, ApiKeyName="apiKey"])),
        items = Source[items],
        items1 = items{0},
        address = items1[address]
    in
        address