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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Asamadi
Helper I
Helper I

Custom column name of tables

I have 5 tables in Edit query

i want to append these 5 Tables and create a custom column that is the table names

how can i do that by M Query?

4 REPLIES 4
Anonymous
Not applicable

HI @Asamadi,

 

I'd like to suggest you define a custom table with table names and these tables which you mentioned.
then expand table column to achieve your requirement.

 

Sample:

let
    Source = #table(type table[#"Source"=text, #"Detail"=table], {{"Table1",#"Patient Link"},{"Table2",#"Patient"},{"Table3",#"Patient Review date"},{"Table4",#"Smoking"},{"Table5",#"Smoking status"}})
in
    Source

11.PNG

 

Expand:

12.PNG13.PNG

 

Reference link:

Creating Tables In Power BI/Power Query M Code Using #table()

 

Regards,

Xiaoxin Sheng

Thanks that works but unfortunately it needed to type the tables name

that is not a solution in my opinion and i am lookign to do the same thing

Hardik
Continued Contributor
Continued Contributor

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors