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 was trying to update Datasource path for Dataverse dataset using rest api but getting error while using below payload
Solved! Go to Solution.
Hi,@anandsharma .I am glad to help you.
Due to my work environment, I was unable to use a dataverse data source that replicates your actual environment, so I implemented this API using a SQL Server database:
Datasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
This API enables you to modify the data source by modifying the value of a parameter in your report.
1. You need to create a parameter to store the data source information for your report.
I named it DatabaseName, and the parameter value is AdventureWorksDW2017.
2. You need to use this parameter in your power query Advanced Editor to replace the original data source name to get the data source (the use of the parameter can make the management of the data source more convenient, you only need to change the data source parameter to modify the data source, which is also the work of the implementation of this API)
After publish to Power BI Service, you can see that the original data source is AdventureWorksDW2017.
Meanwhile I successfully configured the gateway connection
copy the power BI service web url groupID:
You need to get the ID of the DataSet used by the report you want to modify.
Use another API:
Datasets - Get Datasets In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
This API is a get request, you need to enter the groupID you just entered to get to this DataSet.
After the API runs successfully, find the corresponding report that needs to be modified and copy the corresponding id value (DataSetID).
Use the API that I recommend for you:
Datasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
JSON post request body:
Retrieve the parameter defined in the report: “DatabaseName”, change the value of the parameter
representing the data source to the new data source you need to modify.
{
"updateDetails": [
{
"name": "DatabaseName",
"newValue": "AdventureWorksDW2022"
}
]
}
After a successful run, refresh your browser and subsequently go back to the Power BI Service and view the report's data source, where the modification has successfully occurred (the parameter was modified successfully)
Since I had previously created separate gateway connections for both databases (2017 and 2022), the system automatically changed the database gateway connections when it detected a change in the data source (switching to database 2022)
The data source was successfully modified by using the API (by modifying the data source parameters)
I hope my test will give you good advice, I have also uploaded my test file.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,@anandsharma .I am glad to help you.
Due to my work environment, I was unable to use a dataverse data source that replicates your actual environment, so I implemented this API using a SQL Server database:
Datasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
This API enables you to modify the data source by modifying the value of a parameter in your report.
1. You need to create a parameter to store the data source information for your report.
I named it DatabaseName, and the parameter value is AdventureWorksDW2017.
2. You need to use this parameter in your power query Advanced Editor to replace the original data source name to get the data source (the use of the parameter can make the management of the data source more convenient, you only need to change the data source parameter to modify the data source, which is also the work of the implementation of this API)
After publish to Power BI Service, you can see that the original data source is AdventureWorksDW2017.
Meanwhile I successfully configured the gateway connection
copy the power BI service web url groupID:
You need to get the ID of the DataSet used by the report you want to modify.
Use another API:
Datasets - Get Datasets In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
This API is a get request, you need to enter the groupID you just entered to get to this DataSet.
After the API runs successfully, find the corresponding report that needs to be modified and copy the corresponding id value (DataSetID).
Use the API that I recommend for you:
Datasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
JSON post request body:
Retrieve the parameter defined in the report: “DatabaseName”, change the value of the parameter
representing the data source to the new data source you need to modify.
{
"updateDetails": [
{
"name": "DatabaseName",
"newValue": "AdventureWorksDW2022"
}
]
}
After a successful run, refresh your browser and subsequently go back to the Power BI Service and view the report's data source, where the modification has successfully occurred (the parameter was modified successfully)
Since I had previously created separate gateway connections for both databases (2017 and 2022), the system automatically changed the database gateway connections when it detected a change in the data source (switching to database 2022)
The data source was successfully modified by using the API (by modifying the data source parameters)
I hope my test will give you good advice, I have also uploaded my test file.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I want to just update path for the given Dataverse dataource. How can we write it in paramter form?
Hi,@anandsharma . I am glad to help you.
Based on the content of the body of the post request you sent in json format, it appears that you are using this Power BI Rest API.
URL:
Datasets - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
If this is indeed the RestAPI, I note that the API limitations state that it only supports certain data source types.
Like this:
The datasource type you need to modify is Dataverse .
Dataverse is not in this list of supported datasource types. This means that if you want to update a Dataverse datasource, you should use the Update Parameters In Group API.
URL:
Datasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
The Update Parameters In Group API has no specific data source type restrictions, so you can use this API to update all types of data sources, including Dataverse.
When using this API, you need to be aware of the following:
User permissions: The requesting user must be the owner of the dataset, or use a service subject profile with appropriate permissions.
Call Scope: The permission scope of Dataset.ReadWrite.All is required.
If my understanding is wrong, please let me know and upload the official Rest API documentation you are using.
Please check the scenario you are using for your API request, whether it is for Power BI Service, or Power BI Report Server, these two different service scenarios use different kinds of APIs, to avoid using the wrong classification of Rest API.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
5 | |
4 | |
3 | |
2 | |
1 |
User | Count |
---|---|
7 | |
6 | |
6 | |
4 | |
3 |