Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
jaryszek
Super User
Super User

Change parameters rest api dynamically using powerShell - write error

Hi Guys,

 

i have issue with WriteError using pwoerShell and power BI rest Api.

Command to connect to power bi rest API:

1) Login-PowerBI
2)  Get-PowerBIDataset which is throwing this result:

jaryszek_0-1657110994619.png

 

and i am interested in changing parameters for shown dataset.

3) Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/datasets/16d0298e-4dda-493b-baf9-0bbbf84d1995/parameters" -Method GET

jaryszek_1-1657111048848.png

 

and as you can see i have 2 parameters and want to change DatabaseName from "test" to "unit"

4) declaring body variable like here:

jaryszek_2-1657111125407.png

return from this:

jaryszek_3-1657111141217.png

 

but last method is not working for me:

 

Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/datasets/16d0298e-4dda-493b-baf9-0bbbf84d1995/Default.UpdateParameters" -Method POST -Body $body 

 

jaryszek_4-1657111177028.png

 

Can anybody help and say why it is not working?

 

Fiddler's answer:

CE
{"error":{"code":"InvalidRequest","message":"Dataset parameter at position 1 is invalid in 16d0298e-4dda-493b-baf9-0bbbf84d1995. Reason: ActionNotSupported","target":"16d0298e-4dda-493b-baf9-0bbbf84d1995"}}
0


Best,
Jacek

 



 

1 ACCEPTED SOLUTION
jaryszek
Super User
Super User

Ok,
parameter has to be as text lol not Any...

 

Best,
Jacek

View solution in original post

4 REPLIES 4
TheGreen
New Member

I'm trying to use this method to update which database the report is supposed to connect to as well but running into the same invalid operation error. You say you solved it, but I don't quite understand how. Could you elaborate? 

jaryszek
Super User
Super User

Ok,
parameter has to be as text lol not Any...

 

Best,
Jacek

jaryszek
Super User
Super User

Ok what i am noticing when i am in power BI Service i can not edit parameters manually also! Why?

jaryszek_1-1657184384403.png

 

 

Best,
Jacek

 

jaryszek
Super User
Super User

Anyone is using this method to change parameters?

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.