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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Is it possible to populate a column with the name of another table?

Hello

 

If I load a table from an excel file to PowerBI, can I create a new column in the table and populate it with values that equal to the name of the loaded table?

 

In other words, can I use the name of a table as a variable or value to put in fields?

 

Thanks!

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, you may click 'Edit Query', go to Query Editor, create a new blank query.

 

If you use Excel connector, you may input the following codes in the 'Advanced Editor'.

b1.png

 

Then you need to input the Filename to get the result.

b2.png

 

If you use folder connector, you may input the following codes in 'Advanced Editor'.

b3.png

 

Here is the result.

b4.png

 

Best Regards

Allan

 

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

 

camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

If you are using Power Query you can go to to 2nd step and filter the files you wanna get, remove the other columns and expand the rows...so you will get a column with the sheet name.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Thanks but not sure if I was understood.

 

The xls I am loading is called Excel1.xls and its sheet is called Table1.

 

The table it contains is:

Header1Header2Header3
rkf
obr
evp

 

I want to create a table like this:

Header1Header2Header3NewColumn1NewColumn2
rkfTable1Excel1
obrTable1Excel1
evpTable1Excel1

 

How can I do that?

 

Thanks!

@Anonymous ,

 

Check this file: Download PBIX 

 

Just go to Transform Data and edit the parameter for path.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



amitchandak
Super User
Super User

@Anonymous , Example of moving data from one table to another

New column in table1

New Column = maxx(filter(table2,table2[Col1]= table1[col1] && table2[Col2]= table1[col2] ),table2[required_col])


New column in Table 1 = maxx(filter(table2,table1[customer] = table2[customer] && table2[option]="construction",table2[value])

New column in Table 1 = maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project]),table2[name])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors