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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors