Using a Power BI App to Upload CSV Files to a Dataset

Since Power BI has gone to preview there have been a lot of great apps created by our developers that really enhance the Power BI experience. In this guest blog Rui Romano from DevScope will walk you through an application they built that really enhances the Power BI developer experience. This app is the Power BI PowerShell Modules. The PowerShell Modules for Power BI are a wrapper around the Power BI REST APIs that allows a user to call all of the API functionality without having to know things like REST or OAuth and without having to register any new applications with Azure Active Directory. Take it away Rui:

We are going to walkthrough a specific example of what you can do with the Power BI PowerShell modules. Say we wanted to upload the data in a CSV file to a dataset in Power BI and then append new data to the same dataset as new files arrive. Below is the script that someone could write:

A login dialog will show up and ask you to log into Power BI and consent to certain permissions:

Once you consent, the data upload will begin.

Once the upload is complete, the CSVData directory will now look like this:

and you will also see a new dataset created in Power BI:

You can explore this dataset by clicking on it and quickly create a Report on your csv files data:

And then pin your favorite report items to a live Power BI dashboard:

If a new CSV file is dropped into the \CSVData directory, they will automatically be uploaded, the new data will be appended to the existing PowerBI data and the dashboard will update right in front of you (no need to refresh, it will update automatically!):