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.
Hi,
I'm having trouble with updating dataset parameter on my report.
the process itself is quite simple :
1. request an oauth token
2. publish my template to power bi service
3. get the published dataset and report ID
4. update parameter on the published report's dataset
this is the code that I'm using :
function getDataset_Report(accessToken) {
xmlHttp.open("GET",getReportIDUrl,true);
xmlHttp.setRequestHeader('Authorization', 'Bearer '+accessToken);
xmlHttp.responseType = "json";
xmlHttp.onload = function () {
if (xmlHttp.readyState === xmlHttp.DONE) {
if (xmlHttp.status === 200) {
var d = xmlHttp.response.datasets;
var r = xmlHttp.response.reports;
if (r != 0 && d != 0) {
console.log('---------------start updating parameter----------------')
reportId = r[0].id;
console.log(reportId);
datasetId = d[0].id;
console.log(datasetId);
embUrl = r[0].embedUrl;
clearInterval(set_interval_id);
var changeParamUrl = "https://api.powerbi.com/v1.0/myorg/groups/" + groupId + "/datasets/" + datasetId + "/Default.UpdateParameters";
changeParam(changeParamUrl, accessToken, paramData, datasetId)
console.log('---------------finished updating parameter----------------')
} else {
run_getDataset_Report(accessToken)
}
}
else{
removeLoading();
};
}
}
xmlHttp.send();
}
function changeParam(theUrl,accessToken,paramData, datasetId) {
console.log(paramData);
xmlHttp.open("POST",theUrl,true);
xmlHttp.setRequestHeader('Authorization', 'Bearer '+accessToken);
xmlHttp.setRequestHeader("Content-type","application/json");
xmlHttp.onload = function () {
if (xmlHttp.readyState === xmlHttp.DONE) {
if (xmlHttp.status === 200) {
console.log('---------------start refreshing datasets----------------')
var getDatasourceUri = "https://api.powerbi.com/v1.0/myorg/groups/"+ groupId +"/datasets/" + datasetId + "/datasources"
getDatasourceInfo(getDatasourceUri, accessToken, paramData, datasetId)
console.log('---------------finished refreshing datasets----------------')
}
else{
removeLoading();
};
}
}
xmlHttp.send(paramData);
};
now the strange thing about this problem is I have 3 reports, 2 already existed reports and 1 new report.
this problem only occurred on my new report which I'm trying to publish.
when I use this code to update the parameter on the other two it works just fine.
now, I also compared the settings between my new report and the old one:
1. both already have the parameter "Enabled Load" checked
2. both are being released by the same application user, which have admin permission
3. both are being released to the same powerBI workspace
the only difference that I could think of is my new report is created after I updated my powerBI desktop,
but I don't think it would have any effects or whatsoever on this problem.
any insight would be greatly appreciated.
bests,
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 |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |