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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Combine files with structure change

Hi all,

 

In PowerBI I have setup a query to retrieve several CSV files from a datasource. The query also combines these files into a single table using the 'combine files' function. 

When new files are added at the datasource (these are log files), the extra files are also combined automatically and added to the table in PowerBI. This works perfectly.

 

Now the following scenario: a new log file has a different structure, for example a column is added. I don't get to see this column added to the combined table. Probably because PowerBI is basing the structure of the table on the first file only?

 

Is it even possible to take into account structure/schema changes? Or will this always be based on the first file?

 

Thanks in advance!

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

So, you can change which file is used as your sample file. There is an spot in the Folder query structure that allows you to change this. Also, since it is CSV, this defaults to specifying the number of fields in the Source line. You could edit this and remove that specification, that is the usual fix then you get a CSV file that changes the number of columns after you initially create the query.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

So, you can change which file is used as your sample file. There is an spot in the Folder query structure that allows you to change this. Also, since it is CSV, this defaults to specifying the number of fields in the Source line. You could edit this and remove that specification, that is the usual fix then you get a CSV file that changes the number of columns after you initially create the query.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler,

 

I've just come across this post while trying to solve my own problem - instead of CSV I am trying to combine .xls files without knowing which one has the most columns. Is there a way for it to default to the most it finds or something similar?

 

Regards,

Xarius

did anybody find a solution for this?

Anonymous
Not applicable

Thanks, that worked for me. This is what I changed:

Capture1.PNGCapture2.PNG

 

 

 

@Anonymous,

 

By the way, you may help accept solution. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.