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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Trebor84
Helper II
Helper II

Append empty table

Hi,

 

I have an issue when trying to append two tables in Power Query.

 

I have two tables that are both linked to SharePoint folders and both queries pull in all files from each sub directory.

On a daily basis we have ongoing work files (table1) and completed work (table2).

 

Before I import any new queries each day, I get a unique list of job ID’s by appending both of these tables then remove duplicate ID’s,


The problem I have is that there isn’t always ongoing work files in the folder so if the folder is empty then it breaks the query due to the table being empty and I receive the below error.

 

An error occurred in the ‘Sample File (3)’ query. Expression.Error: There weren't enough elements in the enumeration to complete the operation.

 

This then prevents me appending table 1 to table 2.

 

Is there any way I can prevent this from happening so if table 1 is empty then it doesn’t do the append step? I have read that a try...otherwise statement might help?

 

The problem is that as the table returns the above error I can’t even see it when I bring up the append window as Power Query doesn’t list the table (table1).


I’m not trying to create a new table, just trying to append table1 data into table2.

 

Any suggestions please?

2 REPLIES 2
jennratten
Super User
Super User

Hello - this is a common problem.  I handle this by including a sample data table (not loaded) that has all of the elements that would be required to make the queries execute successfully, but contains a keyphrase or value which is specifically used to remove the sample rows after processing is complete.  Based on the task at hand, it sometimes makes sense to append the sample data table right from the start and then filter it out at the end.  In other scenarios, it may make sense to conditionally append the tables based on whether or not the actual table has rows, or simply use one or the other using try/otherwise.  The construct of my sample data table is the same regardless of which scenario is encountered and I usually create the sample data table by copying some of the rows from a real table and pasting it into a new table, then changing the values.

I hope this info helps!  Please let me know if you have any questions.

NikhilChenna
Skilled Sharer
Skilled Sharer

Hi @Trebor84 ,

You cannot keep the table empty , it will not work and give you error. 

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.