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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Raul
Post Patron
Post Patron

Filter table names in a connection to a SQL Server database

Hello everyone.

I have a SQL Server database that contains more than 20,000 tables. I need to connect from Power BI Desktop to that database but I want to be able to filter the selection of the necessary tables for those starting with a certain prefix, for example, those starting with CUST *.
How can I specify this initial filter so that I can subsequently select the tables I need without having to load all the tables of the database before in the Navigator screen?

Thanks a lot!!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Raul,

 

Please refer to below steps to filter the tables which stored in database.


Steps:

1. Connect to a database.

large.png

 

 

2. Add a filter on 'Name' column and modify the filter formula to use 'Text.StartsWith' function.(For your scenario, you should use "CUST " as keyword to filter.)

4.PNG

 

Full query:

let
    Source = Sql.Databases("xxxxx"),
    #"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Name],"D"))
in
    #"Filtered Rows"

 

BTW, please not connect too many table at one time. Large amount of tables may affect the performance and system resources.

 

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Raul,

 

Please refer to below steps to filter the tables which stored in database.


Steps:

1. Connect to a database.

large.png

 

 

2. Add a filter on 'Name' column and modify the filter formula to use 'Text.StartsWith' function.(For your scenario, you should use "CUST " as keyword to filter.)

4.PNG

 

Full query:

let
    Source = Sql.Databases("xxxxx"),
    #"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Name],"D"))
in
    #"Filtered Rows"

 

BTW, please not connect too many table at one time. Large amount of tables may affect the performance and system resources.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors