<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Programmatically change CSV data source in PBIX file in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-change-CSV-data-source-in-PBIX-file/m-p/365790#M10891</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an ETL tool that operates on certain targets. Each ETL run produces a set of CSV files in certain well-defined shape.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have chosen a single set of CSVs as a data source for PBIX file. After importing them, I&amp;nbsp;create variety of visualizations (grids, matrix, column bars, sankeys, etc) to display the data in various pleasing ways.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;1. make a copy of PBIX file&lt;/P&gt;&lt;P&gt;2. open new file Power BI Desktop&lt;/P&gt;&lt;P&gt;3. adjust path to&amp;nbsp;CSV data source files to the new folder&lt;/P&gt;&lt;P&gt;4. save and apply queries to update the visualizations with new data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thinking that this might be just a variation on OpenXML Office file format, I tried the following:&lt;/P&gt;&lt;P&gt;- Unzip the PBIX file&lt;/P&gt;&lt;P&gt;- Unzip the&amp;nbsp;DataMashup file (complains about&amp;nbsp;there being data past the end of file though)&lt;/P&gt;&lt;P&gt;- Edit&amp;nbsp;"DataMashup\Formulas\Section1.m" to point to the new location&lt;/P&gt;&lt;P&gt;- Zip everything up into PBIX file&lt;/P&gt;&lt;P&gt;However, Power BI Desktop complains about the file being corrupted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is what I am trying to do possible?&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2018 06:14:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-27T06:14:11Z</dc:date>
    <item>
      <title>Programmatically change CSV data source in PBIX file</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-change-CSV-data-source-in-PBIX-file/m-p/365790#M10891</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an ETL tool that operates on certain targets. Each ETL run produces a set of CSV files in certain well-defined shape.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have chosen a single set of CSVs as a data source for PBIX file. After importing them, I&amp;nbsp;create variety of visualizations (grids, matrix, column bars, sankeys, etc) to display the data in various pleasing ways.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;1. make a copy of PBIX file&lt;/P&gt;&lt;P&gt;2. open new file Power BI Desktop&lt;/P&gt;&lt;P&gt;3. adjust path to&amp;nbsp;CSV data source files to the new folder&lt;/P&gt;&lt;P&gt;4. save and apply queries to update the visualizations with new data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thinking that this might be just a variation on OpenXML Office file format, I tried the following:&lt;/P&gt;&lt;P&gt;- Unzip the PBIX file&lt;/P&gt;&lt;P&gt;- Unzip the&amp;nbsp;DataMashup file (complains about&amp;nbsp;there being data past the end of file though)&lt;/P&gt;&lt;P&gt;- Edit&amp;nbsp;"DataMashup\Formulas\Section1.m" to point to the new location&lt;/P&gt;&lt;P&gt;- Zip everything up into PBIX file&lt;/P&gt;&lt;P&gt;However, Power BI Desktop complains about the file being corrupted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is what I am trying to do possible?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 06:14:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Programmatically-change-CSV-data-source-in-PBIX-file/m-p/365790#M10891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-27T06:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically change CSV data source in PBIX file</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-change-CSV-data-source-in-PBIX-file/m-p/429868#M13084</link>
      <description>&lt;P&gt;I've realized that I can build a PBIT template file and solved the problem that way.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 03:27:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Programmatically-change-CSV-data-source-in-PBIX-file/m-p/429868#M13084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-01T03:27:57Z</dc:date>
    </item>
  </channel>
</rss>

