Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have created and published 5 reports within a workspace. Each report is almost the clone of the other with the differnce being the credneitals of the API. The SaaS platform we query distinguishes between each customers by credentials. This should allow me to query all 5 customers and display the summary titles on a dashboard.
However when I set the credentials for one customer in the workplace these are applied to all models within that workplace.... im assuming because the API URL is the same.
Im setting the privacy to org so that other users can see the data although I dont think that is related.
Can anyone think of a way that I can keep the creds unique per model when the API URL is the same.
Solved! Go to Solution.
I think I found a solution. I dont like the fact I have to make credentials visible in the code but it works in PBID and the app service.
let
// Your username and password
Username = BasicAuthUsername,
Password = BasicAuthPassword,
// Encode the credentials
Credentials = Binary.ToText(Text.ToBinary(Username & ":" & Password), BinaryEncoding.Base64),
// URL of the web source
SourceUrl = "https://www.example.co.uk",
// Retrieve the data with authorization header
Source = Json.Document(
Web.Contents(SourceUrl, [
Headers = [Authorization = "Basic " & Credentials]
])
),
// Retrieve the data with authorization header
Records = Source[Records],
I think I found a solution. I dont like the fact I have to make credentials visible in the code but it works in PBID and the app service.
let
// Your username and password
Username = BasicAuthUsername,
Password = BasicAuthPassword,
// Encode the credentials
Credentials = Binary.ToText(Text.ToBinary(Username & ":" & Password), BinaryEncoding.Base64),
// URL of the web source
SourceUrl = "https://www.example.co.uk",
// Retrieve the data with authorization header
Source = Json.Document(
Web.Contents(SourceUrl, [
Headers = [Authorization = "Basic " & Credentials]
])
),
// Retrieve the data with authorization header
Records = Source[Records],
It certainly appears that is the issue. Im now having to look at how to pass the creds within the file as a param.
I would say this is a shortcoming of the platform. Credentials should be report or model specific not workspace. We can see they thought of this in PowerBI Desktop considering these options and I am sure it used to work but I expect the by product of another idea has caused this issue.
Hi. Unless you can get all the data with a single credential and then filter by customer at Power Query, I don't think you can make it with "just PowerBi". Like you are saying, Power Bi stores data sources in order to make it easy for refreshes and developers. If you have a data source with an address and type, it stores the credential for that specific one to replicate it each time you use it.
You might need to add another layer to your proyect. Like a database, datalake or warehouse. That can help you storing the data from an ETL or code tool that can get the data from the API. For example, writing a notebook that runs the api for each credential and the stores it on the storage. After that you could connect Power Bi.
I hope that helps,
Happy to help!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
39 | |
26 | |
21 | |
19 | |
10 |
User | Count |
---|---|
41 | |
36 | |
34 | |
20 | |
14 |