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

Join 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.

Reply
ash206
New Member

Programmatically get data from datasource into an embedded report

Can I programatically access a data source (such as Amazon Athena), retrieve a CSV from it, then convert it to a dataset for an embedded report?

 

I was hoping to do this with PowerBI REST APIs but wasn't sure.

 

Constraint: I'd like to leverage the gateway connection between Athena and PowerBI without using PowerBI Desktop.


To my knowledge, if I have an embedded PowerBI report, I can dynamically bind to different datasets as long as the schemas match. I was hoping to do this all on a website without manually setting it up.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @ash206,

I don't think you can fully automate it by programming codes. The query table and data transformation steps can not able to be configured or effect by the rest API.

If you mean to dynamic change the data source on the power bi service side by rest API, it is possible. You can parameterize your connection string with query parameters, then you can use the update parameter API to change and modify the data source mapping. 

Using the Power BI Service Parameters to change connection strings (To possibly change between Dev 

Datasets - Update Parameters - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Notice: query table will cache the data structure into the query steps, do these data source should have the same data structure, or refresh will be failed and return an error for 'key not match'

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @ash206,

I don't think you can fully automate it by programming codes. The query table and data transformation steps can not able to be configured or effect by the rest API.

If you mean to dynamic change the data source on the power bi service side by rest API, it is possible. You can parameterize your connection string with query parameters, then you can use the update parameter API to change and modify the data source mapping. 

Using the Power BI Service Parameters to change connection strings (To possibly change between Dev 

Datasets - Update Parameters - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Notice: query table will cache the data structure into the query steps, do these data source should have the same data structure, or refresh will be failed and return an error for 'key not match'

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.