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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Programmatically change CSV data source in PBIX file

Hello everyone,

 

I have an ETL tool that operates on certain targets. Each ETL run produces a set of CSV files in certain well-defined shape.

 

I have chosen a single set of CSVs as a data source for PBIX file. After importing them, I create variety of visualizations (grids, matrix, column bars, sankeys, etc) to display the data in various pleasing ways.

 

I would like to target a different set of CSVs without having to recreate data connections and visualization widgets. To do this manually, I can do the following:

1. make a copy of PBIX file

2. open new file Power BI Desktop

3. adjust path to CSV data source files to the new folder

4. save and apply queries to update the visualizations with new data

 

Now I would like to automate those steps. I do not see any API for manipulating PBIX files, and the file format appears to be opaque. 

 

Thinking that this might be just a variation on OpenXML Office file format, I tried the following:

- Unzip the PBIX file

- Unzip the DataMashup file (complains about there being data past the end of file though)

- Edit "DataMashup\Formulas\Section1.m" to point to the new location

- Zip everything up into PBIX file

However, Power BI Desktop complains about the file being corrupted

 

Is what I am trying to do possible?

1 REPLY 1
Anonymous
Not applicable

I've realized that I can build a PBIT template file and solved the problem that way.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Top Solution Authors