Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
let
#"HR-On employees" = let
// Parametre
client_id = "xxx",
client_secret = "yyy",
api_url = "url",
token_url = "token",
// Obtain Authorization Credentials
ObtainAuthorizationCredentials = Json.Document(
Web.Contents(token_url,
[
Content = Text.ToBinary("grant_type=client_credentials&client_id=" & client_id & "&client_secret=" & client_secret),
Headers = [#"Content-Type" = "application/x-www-form-urlencoded"]
]
)
),
refresh_token = ObtainAuthorizationCredentials[refresh_token],
access_token = ObtainAuthorizationCredentials[access_token],
// Brug token til at hente data
Kilde = Json.Document(
Web.Contents(
api_url,
[
Headers = [Authorization = "Bearer " & access_token]
]
)
),
items = Kilde[items]
in
Kilde,
items = #"HR-On employees"[items],
#"Konverteret til tabel" = Table.FromList(items, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Udvidet Column1" = Table.ExpandRecordColumn(#"Konverteret til tabel", "Column1", {"id", "companyAdmin", "leader", "systemUser", "archived", "picture", "systemFields", "customFields", "departments", "roles", "createdAt", "updatedAt", "customId"}, {"id", "companyAdmin", "leader", "systemUser", "archived", "picture", "systemFields", "customFields", "departments", "roles", "createdAt", "updatedAt", "customId"})
in
#"Udvidet Column1"
When I run my script in power bi desktop, everything is fine, and no prompt for credentials, since everything is handled in the script.
But when I upload to Power BI it prompts for credentials and they are not needed. I have tried anonymous, my own etc. but it errors.
What might be the error?
Solved! Go to Solution.
Just don't test the connection and everything is fine
Just don't test the connection and everything is fine
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 |