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.
I'm trying to retrieve data from Power BI API services and the same is being accomplished via PowerShell code. But unfortunately due to some circumstances I am not able to deploy it in production. Hence now I am trying to get the same thing done in Power BI desktop itself so that I can call power BI rest API from Power Query only. There are tons of blogpost about calling an API in power query but they all require Power BI App registered Client ID. Which I don't have. I'm successfully able to call with my user name password in PowerShell and even I'm getting response from API.
Please find below PowerShell code and let me know if we can replicate the same in Power Query.
# User credential
$User = 'shahab***@*****.com'
$Pword = ConvertTo-SecureString –String '***password***' –AsPlainText -Force
$Credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User,$Pword
# Connect to service
Login-PowerBIServiceAccount -Credential $Credential
#Get Bearer token
$headers = Get-PowerBIAccessToken
$uri = 'https://api.powerbi.com/v1.0/myorg/datasets/f52f2abc-6445-41ee-ce02-3908c6e18dd4/refreshes'
$refreshes = Invoke-RestMethod -Uri $uri -Headers $headers -Method GET
$xs= $refreshes
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 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |