Power Query: Files With No Data

Pulsar3000

New Member
Joined
Apr 19, 2021
Messages
44
Office Version
  1. 365
Platform
  1. Windows
Hello All:

I'm using power query to import multiple CSV files with different sets of data into one workbook in which each tab reflects one of the imported CSV files. The source used is a folder via a dynamic path that changes based on the month.

An issue I've run into is that sometimes the same report may not have any data in one month vs another month. As a result, if I import a report/file one month with data and the same report next month but with no data, it keeps the data from the prior month/file.

Q1. What is the best way to avoid this without using VBA?

I know I can filter the file size in a file listing within Power Query but the issue remains.

Q2: Can you use Power Query to change a tab color based on a condition from a separate tab?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
PQ reloads everything from scratch on each refresh (unless you use incremental refresh). If you change the files each month, what behaviour are you expecting?

PQ loads data. It cannot change tab colour
 
Upvote 0
PQ reloads everything from scratch on each refresh (unless you use incremental refresh). If you change the files each month, what behaviour are you expecting?

PQ loads data. It cannot change tab colour
I have two different circumstances.

1. If there's no data, I'd like to simply import a blank table.

2. I need to merge two tables and if one of them has no data, I need that table excluded from merging. A conditional merge based on tables having data.
 
Upvote 0

Forum statistics

Threads
1,223,348
Messages
6,171,572
Members
452,411
Latest member
colpie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top