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
asadhkhan
Frequent Visitor

Programmatically Create new Report, New Dataset, change Data Source from a template report

I am trying to create reports programmatically.

 

The first step is to clone an existing report that I'll use as a template. This works as expected.

 

Next I need to create a new dataset based on the source report dataset (the Model will be the same).  The data source will also get updated, but the schema will be the same., this is where I do not understand how to do it.  I see options to update pbix and republish, but I want to remove the manual process.

 

any guidance will be great.

 

3 REPLIES 3
Anonymous
Not applicable

Hi @asadhkhan ,

 

To meet your need requires the creation of multiple data sets.There is currently no API for copying datasets, so the need to avoid Pbix files is not possible for now.

If you would like to suggest some feature improvements, you may also vote the  idea  here and comment there to improve this feature. It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Hope it helps,

 

Best Regards,
Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

HenriqueReis
Resolver I
Resolver I

Hi, how are u?

 

You should use GATEWAY:

 

It serves as a pathway between your on-premises data and your cloud-based apps. A gateway is secure and encrypted, so you know your data is safe as it travels. It requires correct authentication in order to access the data, so it will only open for registered users. 

A gateway does not actually transfer data, which means it stays on your server even as clients access it. It simply provides a connection point to the cloud. A gateway allows users to access the data for the purposes of making reports or dashboards.

The gateway also allows you to refresh your reports with current data regularly. It’s free to install and relatively simple to configure.

 

 

And here's about to install it in your computer:

 

You’ll want to ensure you are physically connected to the internet because many analysts have noticed lagging from their gateway when using a wireless connection. 

It can be tricky to convert from personal mode to standard mode on a device, so think carefully about which one you will need for the long term. Standard mode comes highly recommended and can generally suit your needs the best.

To install:

  • From your Power BI Workspace, click the download arrow in the top right and choose “Download Gateway”
  • A download page will open: click “Download Gateway” again
  • Click “next” to enter the installer
  • Choose the mode you prefer
  • Confirm terms and conditions
  • Sign in to your Power BI account
  • Register the Gateway with your computer
  • Choose a name and a recovery key for your gateway

Once your gateway is installed and registered, you are ready to put it to use. You’ll need to connect the data sources you want to the gateway.

To add a data source to your gateway, you’ll first need to get the file path for an on-premises file. 

  • Open a .pbix in Power BI Desktop
  • Click edit queries
  • Click data source settings
  • Choose the data source you want front the list and click change source
  • Copy the file path from the box that opens

Once you have the file path copied, open Power Bi Service online and go to Settings.

  • Click manage gateways and choose the gateway you want to connect
  • Click add data source
  • Copy your file path into the box and enter the other information
  • Click add: you should get a confirmation that the connection was successful

 

Regards from Brazil!

 

Thank you Henrique.  But my source us not from on-prem, my source comes from Azure SQL.  

 

Each user has a copy of their own table so when a user makes a copy of the report we want to be able to change the source and create a new dataset based on the original model but want to do this via API. 

 

We want to avoid touching the pbix. File.  

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.