Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello, I am having some difficulties updating a dataset parameter via the PBI rest api. I am using PowerShell and "Import-Module MicrosoftPowerBIMgmt".
I have based my script on these ressources:
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters
https://community.powerbi.com/t5/Developer/Update-parameters-through-Powershell/td-p/1167203
I am pretty sure I got the syntax right, but the script *sometimes* returns an error, and I can't see any cange in the dataset after running it.
I have defined a string parameter named ReportVersion which I am trying to update. The parameter has "enable load" checked off and is visible in the report.
This is how I attempt to do it:
Connect-PowerBIServiceAccount
$datasetId = "my dataset id"
$urlUpdateParams = "https://api.powerbi.com/v1.0/myorg/datasets/$($datasetId)/Default.UpdateParameters"
$body = '{
"updateDetails": [
{
"name": "ReportVersion",
"newValue": "2.0"
}
]
}'
$content = 'application/json'
write-host $urlUpdateParams
Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method POST -Body $body -ContentType $content
Disconnect-PowerBIServiceAccount
The error I get looks like this:
Invoke-PowerBIRestMethod : One or more errors occurred.
At C:\...\Power BI report upload tool 10.ps1:83 char:17
+ ... Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method PO ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
Can you help me pinpoint what is going wrong?
Thanks in advance,
Mike
Hi @h4tt3n,
How many requests did you send? Request data size? AFAIK, rest API has its usage limitation, you can take a look at the official document to confirm if your test has exceeded the limits.
Regards,
Xiaoxin Sheng
I am not POST'ing any data to the dataset, just small querys to update parameters or refresh datasets. I find it very hard to believe that these queries should exceeded the daily limit.
Hi @h4tt3n,
Any other operations based on rest API with your power bi contents? In addition, you can also try to remove the front part of the URL, this part seems not to use in the document samples:
$urlUpdateParams = "/datasets/$($datasetId)/Default.UpdateParameters"
Regards,
Xiaoxin Sheng
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |