Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
4 | |
2 | |
2 |
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 |