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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
pfbrp
Frequent Visitor

Table.SelectRows on Sql.Database

The Soruce is an Sql.Database() returning a table of tables accessible through the [ Data ] column.

Some of those tables return data, but some are either empty or denying access.

I want to have a preview of the rows of the Soruce only where tables return data.

In order to achieve it, I do a simple selection:

pfbrp_0-1739961070906.png

try [ Data ]{ 0 } returns Expression.Error for empty returns and Datasource.Error for access denials.

Entire evaluation look simple, yet the PQ gets stuck loading everlasting thousands of rows.

Any ideas?

1 ACCEPTED SOLUTION
dufoq3
Super User
Super User

Hi @pfbrp, check this:

 

Before

dufoq3_0-1739983254396.png

 

After

dufoq3_1-1739983265325.png

let
    Source = #table({"Data"}, {{null}, {#table(null, {})}, {error "Just test ERROR"}, {#table(null, {{1,2,3}})}, {"abc"}, {100} } ),
    FlteredTables = Table.SelectRows(Source, each (try [Data] otherwise false) is table)
in
    FlteredTables

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @pfbrp,

Thanks for reaching out to the Microsoft fabric community forum.

 

It looks like you are trying to filter out tables that are empty or inaccessible. As @dufoq3 and @Akash_Varuna both gave responses of their own for your query, can you please confirm if you were able to solve your issue with the help of their responses. If yes, then please mark the helpful response as solution.

 

I would also take a moment to thank @dufoq3 and @Akash_Varuna, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

dufoq3
Super User
Super User

Hi @pfbrp, check this:

 

Before

dufoq3_0-1739983254396.png

 

After

dufoq3_1-1739983265325.png

let
    Source = #table({"Data"}, {{null}, {#table(null, {})}, {error "Just test ERROR"}, {#table(null, {{1,2,3}})}, {"abc"}, {100} } ),
    FlteredTables = Table.SelectRows(Source, each (try [Data] otherwise false) is table)
in
    FlteredTables

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Akash_Varuna
Super User
Super User

Hi @pfbrp  you could try simplifying the query and try this please as your query is evaluating the whole table on try....otherwise 
Table.SelectRows(
Source,
each
try Value.Is([Data]{0}, type table) otherwise false
)
If this post helped please do give a kudos and accept this as a solution 
Thanks In Advance

With small correction (testing for record instead of table):

pfbrp_0-1739963163635.png

I state that the effect is the same.

Did you mean that a whole table is evaluated at each Table.SelectRows() iteration? Why would it be if I'm checking on the first row only?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.