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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ipon70
Helper I
Helper I

Only import the first date from multiple files

What I am trying to do is import multple excel files that have overlapping dates, but the only date I want to keep is the first one it finds in each file.

EXAMPLE:  I have 31 files, each file contains repeating dates i.e. row 1 is 04/03/2024 row 2 is also 04/03/2024 and so on, this could go on for 5000 rows or 9000 rows, then it changes to 04/04/2024 and does that for 5000-9000 rows and then changes to 04/05/2024.  In the mean time in comes the next days file that now starts with row 1 is 04/04/2024 and row 2 is 04/04/2024.  I only want to keep 04/03/2024 from the first file and 04/04/2024 from the second, I would then keep 04/05/2024 from the third...so on and so forth.

 

This repeats for months of data. and there are overlapping dates in each file by 3 days. In the example below there are only two files in this import 04/04/2024 and 04/05/2024 the two yellow are the only dates I want to keep.  but the 04/03 was from the first file and the 04/04 is from the second file.

example.PNG

 

I hope that makes sense.

 

I have Power BI desktop Version 2.121.903.0.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ipon70 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_8-1712804542506.png

 

"Table (2)"

vnuocmsft_9-1712804567093.png

 

"Table (3)"

vnuocmsft_10-1712804594479.png

 

First, import the data into power bi desktop, click "Transform Data" in the data loading interface to enter the power query.

 

vnuocmsft_0-1712803404814.png

 

Add an index column for each table. Make sure your date columns are arranged from smallest to largest, if not you can adjust them manually.

 

vnuocmsft_2-1712803644783.png

 

Select "Append Queries".

 

vnuocmsft_3-1712803807273.png

 

vnuocmsft_4-1712803909004.png

 

Generate the table below:

 

vnuocmsft_5-1712804143298.png

 

Filtering "Index" equal to 1.

 

vnuocmsft_6-1712804224411.png

 

Click on "Close & Apply" and you can also remove the index column to avoid the impact. Here is the result:

 

vnuocmsft_7-1712804487906.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

 

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @ipon70 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_8-1712804542506.png

 

"Table (2)"

vnuocmsft_9-1712804567093.png

 

"Table (3)"

vnuocmsft_10-1712804594479.png

 

First, import the data into power bi desktop, click "Transform Data" in the data loading interface to enter the power query.

 

vnuocmsft_0-1712803404814.png

 

Add an index column for each table. Make sure your date columns are arranged from smallest to largest, if not you can adjust them manually.

 

vnuocmsft_2-1712803644783.png

 

Select "Append Queries".

 

vnuocmsft_3-1712803807273.png

 

vnuocmsft_4-1712803909004.png

 

Generate the table below:

 

vnuocmsft_5-1712804143298.png

 

Filtering "Index" equal to 1.

 

vnuocmsft_6-1712804224411.png

 

Click on "Close & Apply" and you can also remove the index column to avoid the impact. Here is the result:

 

vnuocmsft_7-1712804487906.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

 

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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