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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Data Import Logic

I am trying to append multiple data sources to one query. Sometimes one of those sources do not have any data, and it presents errors in the appended table. Is there a way to state if there is no data in a source, do not load the source. And then within the appended query, if there is no source loaded, skip append?

 

Not sure if that made sense. But trying to cut out my having to come in and check monthly if there was an error in the source import and to make a temporary adjustment to the appended data table to exclude that source from the import.

 

Thanks,

5 REPLIES 5
edhans
Super User
Super User

Yes. The following formula will do this:

 

 

= if Table.IsEmpty(Table2) = true then Table else Table.Combine({Table, Table2})

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

I have 6 data sets being combined. So would I have to create a lengthy formula laying out each iteration? (i.e. If table 1 empty, then tablecombine 2,3,4,5,6, else if table 2 empty, then tablecombine 1,3,4,5,6)

 

Also, to that point above, how can that formula be simplified so that the else statement combines only those table that are not empty. 

The tables in Table.Combine is a list, so you can use list functions to filter out the nulls, perhaps with this approach.

 

Source = Table.Combine(List.Select({Table1, Table2, ...}, each Table.IsEmpty(_) = false))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Unfortunately, those solutions did not work. So instead of trying to fix my appended data table, I decided to look for a way to fix how the output would be from each source query pulling no data. 

 

What I used was Table.SelectColumns(#"Promoted Headers",{"District", "County", "Highway", "Type of Work", "Let Date", "Project No.", "Control CSJ", "Est. Cost", "Contract Type"}, MissingField.UseNull)

 

I know that the steps after the import data were going to start filtering the data within these columns. So my solution was to basically create a selection of those columns if they existed, if there is a missing field, it would create those columns with no information present. Basically putting a blank table in the data set to filter. 

 

Hi  @Anonymous ,

 

Seems that your issue is solved,right?If so,can you mark the reply as answered to close it?

 

Much appreciated.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors