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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DatataD
New Member

How to run the same query on multiple tables and append (automatically)

Hi all,

 

I've got around 200 csv files which need to be stitched together into the same data table and loaded to Power BI / Power Pivot.

 

The catch is I can't just load the whole folder in because I need to unpivot each table individually because they have dates running across the top in a row and I need them in the same column (different dates covering around three years) so I can't just filter out all the other date headers.

 

At the moment I'm faced with duplicating my query 200 times, changing the source to each individual file and then appending them.

 

Surely there is a better way?

 

Any help appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@DatataD,


You can define data source parameter in the PBIX file. There is a similar blog for your reference, if you have any questions about the code, please let me know.

https://www.fourmoo.com/2016/11/23/power-bi-using-parameters-for-flat-file-csv-excel-sources/

Regards,
Lydia

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@DatataD,


You can define data source parameter in the PBIX file. There is a similar blog for your reference, if you have any questions about the code, please let me know.

https://www.fourmoo.com/2016/11/23/power-bi-using-parameters-for-flat-file-csv-excel-sources/

Regards,
Lydia

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors