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! It's time to submit your entry. Live now!
Hello,
I need help in creating a simple PowerShell script that will update my PBI report parameter.
Body:
{
"updateDetails": [
{
"name": "EndDate",
"newValue": "2020-06-08"
},
{
"name": "StartDate",
"newValue": "2020-06-01"
}
]
}I'm not sure how to followup this code:
Invoke-PowerBIRestMethod -Url "/datasets/datasetID" -Method Post -Body .....This is provided by the Microsoft documentation but i'm having trouble putting it into practice
Invoke-PowerBIRestMethod
-Url <String>
-Method <PowerBIWebRequestMethod>
[-Body <String>]
[-OutFile <String>]
[-ContentType <String>]
[-Headers <Hashtable>]
[-Organization <String>]
[-Version <String>]
[<CommonParameters>]Thank you for your help!
Solved! Go to Solution.
I found it out:
# Update Parameters URL
$urlUpdateParams = '/datasets/{datasetId}/Default.UpdateParameters'
# Update Parameters Body
$body = '{
"updateDetails": [
{
"name": "EndDate",
"newValue": "2020-06-14"
},
{
"name": "StartDate",
"newValue": "2020-06-01"
}
]
}'
$content = 'application/json'
Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method Post -Body $body -ContentType $content # Updates Dataset Parameters
Your API call is incomplete.
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparameters (for regular workspaces)
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparametersingroup (for Premium)
Note that you are not updating report parameters. You are updating dataset parameters.
I found it out:
# Update Parameters URL
$urlUpdateParams = '/datasets/{datasetId}/Default.UpdateParameters'
# Update Parameters Body
$body = '{
"updateDetails": [
{
"name": "EndDate",
"newValue": "2020-06-14"
},
{
"name": "StartDate",
"newValue": "2020-06-01"
}
]
}'
$content = 'application/json'
Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method Post -Body $body -ContentType $content # Updates Dataset Parameters
Did you run this through Powershell?
yes, after authenticating, for example with Login-PowerBI
I grabbed this script from github.
https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/Update-Datas...
I modify the script using my entries.
I run it using Powershell.
No errors are thrown up but the parameters are not changing in the dataset.
Can you please inspect this script please.
I left comments after some of the lines below.
I'm totally new to running commands using Powershell. I'm trying to learn.
My goal is update the Parameters for a particular dataset.
Write-Host
Connect-PowerBIServiceAccount | Out-Null
$workspaceName = "me" //for myworkspace, do I use "me", or "My Workpace"?
$datasetName = "dataset123"
$workspaceId = $workspace.Id
$datasetId = $dataset.Id // is dataset.ID grabbed automatically?
$workspace = Get-PowerBIWorkspace -Name $workspaceName
$dataset = Get-PowerBIDataset | Where-Object Name -eq $datasetName
$workspaceId = $workspace.Id
$datasetId = $dataset.Id
$datasetParametersUrl = "groups/$workspaceId/datasets/$datasetId/Default.UpdateParameters"
$parameterName = "DirectPath_NonOneDrive_JSON"
$newParameterValue = "NewPath"
$postBody = "{updateDetails:[{name:'$parameterName', newValue:'$newParameterValue'}]}"
Invoke-PowerBIRestMethod -Url $urlUpdateParams -Method Post -Body $body -ContentType $content
Thank you.
I authenticated then attempted to run, but does not work for me.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |