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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
clo_64
Frequent Visitor

Merge different Tables

Hi,
my source is a folder with many csv files.
Each file has 2 tables with dynamic lengths and look like that:

NewCustomers

Cust A

Cust B

Cust C

...

BLANK line

LostCustomers

Cust D

....

BLANK line

 

Now when I import all these files in Power BI I get a long table with all these sub-tables:

NewCustomers

Cust A

Cust B

Cust C

...

BLANK line

LostCustomers

Cust D

....

BLANK line

NewCustomers

Cust A

Cust B

Cust C

...

BLANK line

LostCustomers

Cust D

....

BLANK line

...

 

How do I merge all the records from the 2 sub-tables and regroup all the data together to get just 1 Table with the new customers and one with the lost customers.

Thanks 

2 ACCEPTED SOLUTIONS
serpiva64
Solution Sage
Solution Sage

Hi,

you can simply use fill down on a duplicated column then append and filter (see the attached file)

If this post is useful to help you to solve your issue consider giving the post a thumbs up and accepting it as a solution !

View solution in original post

No I really need to split in 2 tables, because these 2 tables have different fields. Sorry I did not want to make the explanation of the issue too complex and omited that.
My csv files looked like that:

NewCustomers
Name           Date          Product

Cust A          xyz             abc

Cust B

Cust C

...

BLANK line

LostCustomers

Name           Date          Reason

Cust D          ghj             blabla

 

View solution in original post

4 REPLIES 4
serpiva64
Solution Sage
Solution Sage

Hi,

you can simply use fill down on a duplicated column then append and filter (see the attached file)

If this post is useful to help you to solve your issue consider giving the post a thumbs up and accepting it as a solution !

that works nicely, and is straight forward.
An additional question: how do I split now the table that they appears as different tables in my Power BI (when I close Power Query). Do I need to keep the original query for New Customers and do a copy/paste to create a new query with a different Table.SelectedRows for the Lost Customer Table. Or there is something easier?  

Hi,

i don't know if i understand well your question.

I think you can also use a unique table (see the new file)

serpiva64_0-1671557194401.png

 

No I really need to split in 2 tables, because these 2 tables have different fields. Sorry I did not want to make the explanation of the issue too complex and omited that.
My csv files looked like that:

NewCustomers
Name           Date          Product

Cust A          xyz             abc

Cust B

Cust C

...

BLANK line

LostCustomers

Name           Date          Reason

Cust D          ghj             blabla

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.