Forum Discussion

jtorres2121's avatar
jtorres2121
Regular Visitor
5 years ago

Automate Report Creation with PowerBI

Hi all,

 

I need to automate the creation of PowerBI reports where the only thing that will change is the location of the data source file (which in my case is a csv file).  Each report will be associated with a unique csv.  The purpose is to look at reports over time to see how the data has changed.

 

After much googling, I figured out I can do this manually using a PowerBI template and passing the location of the csv as a parameter, then publishing the report.  However, I need to automate this process.  There doesn't seem to be a PowerBI cmdlet or API to create a report file from an existing template (pbit) file, that would also allow you to pass in a parameter.

 

Others have run into this issue.  I've read posts where it's suggested to programmatically unzip a pbix file, unzip something else in it, change the location of the source data, zip everything back up - which is impractical to say the least.

 

So far it looks like I'm stuck with doing this manually, unless anyone has any suggestions that don't involve a programmatic surgical intervention.

 

Thank you,

 

- Jorge

3 Replies

  • v-kkf-msft's avatar
    v-kkf-msft
    Community Support

    Hi jtorres2121 ,

     

    I think it is impossible to realize automatic report creation without programming. Maybe you can try to use query parameters to change the data source in the same report.

     

     

    Best Regards,
    Winniz

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

  • jtorres2121's avatar
    jtorres2121
    Regular Visitor

    Thank you for your reply.  Perhaps I didn't explain my problem well enough.

    I understand I can use query parameters to change the data source.  However, how do I do this programmatically?

     

    I am fine with a programmatic approach, but how do I do this?  I don't see a way to do it using a PowerBI cmdlet or a REST API.

     

     

    • v-kkf-msft's avatar
      v-kkf-msft
      Community Support

      Hi jtorres2121 ,

       

      I'm sorry, I misunderstand what you said to that someone could do it. I don't find a way to programmatically create a report. I just know is that use RestAPI to modify the data source of the published datasets.

       

      Best Regards,
      Winniz