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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
hwoehrle
Frequent Visitor

Combine Tables from CurrentWorkbook

Hi,

 

i'm trying to combine selected Tables from my current Workbook. For Example:

 

[Worksheet AW01]

Table "Ref_AW01":

Row

DataTextValue1 
1AAAAA0,7 
2BBBBB2,3 

 

[Worksheet AW02]

Table "Ref_AW02":

Row

DataTextValue1 
1CCCCC0,01 
2DDDD1,2 
3EEEEE5,6 

 

I like to combine all Tables in the Workbook named like "Ref_*" to

Source

 

Row

DataTextValue1
AW011AAAAA0,7
AW012BBBBB2,3
AW021CCCCC0,01
AW022DDDD1,2
AW023EEEEE5,6
..... AW9834   

 

So i tried:

let
  Quelle = Excel.CurrentWorkbook(),
  SelTables = Table.SelectRows(Quelle, each Text.StartsWith([Name], "Ref_")),
  CombTable=Table.Combine(SelTables[Name])
in
  CombTable

 

This raises the follwoing Error:

Expression.Error: Der Wert ""Ref_AW01"" kann nicht in den Typ "Table" konvertiert werden.  ~> The value "Ref_AW01"" can't be converted to type "Table"
Details:
Value=Ref_AW01
Type=[Type]

 

The other Question is, how can i add a column in each Table named like the Table as Source-Reference?

 

Thanks in advance for any hints and tips!

Best regards,

Heiko

1 ACCEPTED SOLUTION
donsvensen
Continued Contributor
Continued Contributor

Hi 

 

The column containing the data in your sample file is called [Content] and not [Name] so the query shoul be like this

 

let
  Quelle = Excel.CurrentWorkbook(),
  SelTables = Table.SelectRows(Quelle, each Text.StartsWith([Name], "Ref_")),
  CombTable=Table.Combine(SelTables[Content])
in
  CombTable 

 

Hope this helps you 

 

/Erik

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

You need to change the statement before in to (hence only change is from Name to Content)

CombTable=Table.Combine(SelTables[Content])

Hence, final code will be 

let
  Quelle = Excel.CurrentWorkbook(),
  SelTables = Table.SelectRows(Quelle, each Text.StartsWith([Name], "Ref_")),
  CombTable=Table.Combine(SelTables[Content])
in
  CombTable

 

donsvensen
Continued Contributor
Continued Contributor

Hi 

 

If you use Table.ExpandTableColumn that might work

donsvensen_0-1647429903569.png

 

If you want to use Table.Combine you have to specify the name of the column with the Tables 

= Table.Combine( #"Filtered Rows"[Content])

 

/Erik

 

Hi Erik,

 

thanks for your reply!

Since there are many tables (with quite a lot columns) i want to combine, i guess the Table.ExpandTableColumn won't do the job.

 

With TableCombine i tried to combine all the selected Tables -> SelTables

CombTable=Table.Combine(SelTables[Name]) as you suggested. Or i misunderstand you.

 

Maybe you can take a look at the example file?

SampleFile 

 

 

 

donsvensen
Continued Contributor
Continued Contributor

Hi 

 

The column containing the data in your sample file is called [Content] and not [Name] so the query shoul be like this

 

let
  Quelle = Excel.CurrentWorkbook(),
  SelTables = Table.SelectRows(Quelle, each Text.StartsWith([Name], "Ref_")),
  CombTable=Table.Combine(SelTables[Content])
in
  CombTable 

 

Hope this helps you 

 

/Erik

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors