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
rmahadik
Regular Visitor

How to access table specified in column of another table ?

Hi Experts,

 

I am desiring below output. Can someone please assist how it can be achieved in power query ? or whether it is feasible or not.

There are following tables loaded.

Table1

Table2

There is Decision table having column1 column2 column3 and single row as below.

column1 - Table ID (1) (whole number)

column2 - Table1 (text) (just name of table)

column2 - Table2 (text) (just name of table)

 

What I want to achieve is to get the row count of Table list in column1 and create additional column in Decision Table with row count of each table in column1. 

 

While doing this I am getting following error as 

Expression.Error: We cannot convert the value "Table1" to type Table.

Details:

    Value=Table1

    Type=[Type]

 

This is because column1 as Table1 (text). However I want to redirect it to actual Table1 and get the row count of Table1. 

Below is the code snippet.

 

rmahadik_0-1661329526635.png

 

 

Please assist on how this can be achieved. Let me know if any more details are required around this issue.

 

3 REPLIES 3
wdx223_Daniel
Super User
Super User

Table.RowCount(Record.FieldOrDefault(#shared,#"Table Name",#table(0,{})))

@wdx223_Daniel 

 

Getting below error

 

rmahadik_0-1661334274398.png

 

What is #shared in the syntax ?

 

Table.RowCount(Record.FieldOrDefault(#shared,#"Table Name",#table(0,{})))

 

@wdx223_Daniel 

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.