cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
priest
New Member

Change Dataset dinamically in one report.

Greetings, i am new to PowerBI and i would like to know how could i do this: -I have mutiple datasets (Which i uploaded from CSV file) and i create a dashboard and a report for one of that datasets, but my doubt is how can i for example, with mutiple datasets each time i select one i would like my report gets the data refreshed. 

 

For what i search i only saw one way to do it , and it was with connection to a DB, and set parameters. Is there a way to do without connection to the database since i only got the CSV files uploaded to PowerBi?? If so can you explain step by spet how to do it? i would apreaciate.

1 ACCEPTED SOLUTION

Hi @priest

Are you using Power BI Desktop or did you connect the file directly to the Power BI Service (online)? 

What you should do is work in Power BI Desktop and follow the steps below; 
- Create a new query and connect to the root folder where all your files are stored. As result you get a list of all files in the folder, for example a sharepoint folder. 
- Now you will see the Content column where the value shows binary for every row. This represents the content of each file. In the columnheader you see a little icon. Click this icon. 
- Now all files will be combined in one new big table. Power BI will create a function which loops over all files in the folder. 

Be warned! Every file needs to be in the same structure and same extension. 

As an example, watch this video. This is Power Query in Excel, but works exactly the same in Power BI. In the video he is creating a custom column with the Excel.Workbook() function. This is not necessary if you just click the small icon in the Content column. Otherwise you won't create a Power BI function to loop over all the files. 
To create a filter in your report to switch between the files, you can keep the Name column which represents the file name or every other column you want. This column can be used in your report as a filter / slicer to dynamicly switch between the files. 



- Marc 

ps. Since you're a beginner. Take a look at the Power BI Cheat Sheet which you can download for free here

View solution in original post

3 REPLIES 3

Hi @priest

Are you using Power BI Desktop or did you connect the file directly to the Power BI Service (online)? 

What you should do is work in Power BI Desktop and follow the steps below; 
- Create a new query and connect to the root folder where all your files are stored. As result you get a list of all files in the folder, for example a sharepoint folder. 
- Now you will see the Content column where the value shows binary for every row. This represents the content of each file. In the columnheader you see a little icon. Click this icon. 
- Now all files will be combined in one new big table. Power BI will create a function which loops over all files in the folder. 

Be warned! Every file needs to be in the same structure and same extension. 

As an example, watch this video. This is Power Query in Excel, but works exactly the same in Power BI. In the video he is creating a custom column with the Excel.Workbook() function. This is not necessary if you just click the small icon in the Content column. Otherwise you won't create a Power BI function to loop over all the files. 
To create a filter in your report to switch between the files, you can keep the Name column which represents the file name or every other column you want. This column can be used in your report as a filter / slicer to dynamicly switch between the files. 



- Marc 

ps. Since you're a beginner. Take a look at the Power BI Cheat Sheet which you can download for free here

It works, but is not the better way i guess since for example lets say i have 20 datasets in my folder, everytime i want to select a new dataset i need to go the my query result and select a option called "load more" to show the the others datasets and select one of them,  it will always take some time to load them each time you wanna do it. When you select the dataset you wanna use you apply the changes and it will load again. 

Hi @priest

I assume that you're still loading only one file right? Why don't you load all files and apply the filtering in datasets in your report? You can do this by clicking the combine button in the query editor.

For filtering, you can keep the source.name column as first column of your table and expand all data after it. After that you can use the source.name column as a slicer in your report. 

 - Marc

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.