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
Anonymous
Not applicable

How to refer to a table by a cell value in another table via Power Query

Hi, I have a table called Table1 with a column called "Table name" saving names of other tables. I am looking to read name from a cell in Table1[Table name], save in a string variable and then refer to that table by the string variable. I am wondering how to do that in M Language or DAX? Thanks! 

1 ACCEPTED SOLUTION
mohammedadnant
Impactful Individual
Impactful Individual

@Anonymous 

 

Try using LookupValue DAX and then ConcatenateX DAX to bring all the value in a string.

LookupValue : https://youtu.be/jPrxonHLGDs

ConcatenateX : https://youtu.be/hPQXNDLiHkI

Multiple values in 1 row Power Query : https://youtu.be/g3uofBDly9w

 

Thanks & Regards,

Mohammed Adnan

Learn Power Platform from my channel TAIK18 click on the link

 

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

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

View solution in original post

5 REPLIES 5
mohammedadnant
Impactful Individual
Impactful Individual

@Anonymous 

 

Try using LookupValue DAX and then ConcatenateX DAX to bring all the value in a string.

LookupValue : https://youtu.be/jPrxonHLGDs

ConcatenateX : https://youtu.be/hPQXNDLiHkI

Multiple values in 1 row Power Query : https://youtu.be/g3uofBDly9w

 

Thanks & Regards,

Mohammed Adnan

Learn Power Platform from my channel TAIK18 click on the link

 

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

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18
Anonymous
Not applicable

Thanks for your reply. Once i get the table name in the string, how to refer to it in DAX and M? E.g.

TableName = "Table2"

 

Can I do something like #TableName to refer to that table?

CNENFRNL
Community Champion
Community Champion

Use Expression.Evaluate function to reference another table with a string variable in Power Query

Screenshot 2021-06-03 090808.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thanks for your reply. I am a Power Query beginner. Can i ask what does #Shared mean in the expression.evaluate function? 

Anonymous
Not applicable

LOOKUP,RELATED or SELECTEDVALUE functions may work for you. Do you have a sample dataset to share?

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.