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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Wani_Muneer
Helper I
Helper I

Load multiple tables using query

using power  query  how can we load multiple tables from Database starting with  'A' 

2 ACCEPTED SOLUTIONS

The simpliest way it two create Query that connects to the Database, then filter text.  

let
    Source = Sql.Databases("Server", "Database"),
    #"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Item], "a") or Text.StartsWith([Item], "A"))
in
    #"Filtered Rows"

You will be left with a list of tables starting with a or A.  Note Power Query is case sensitive.

 

Next you can use the "Add as New Query" to open each table separately and load them to Power BI.

 

DarylLynchBzy_0-1670415762374.png

 

Otherwise you might try the search feature in the Navigator Screen when connecting to the database.  But this more of a wildcard search than start with, and would include the schema table as well.

DarylLynchBzy_1-1670416050306.png

 

 

View solution in original post

@Daryl-Lynch-Bzy But at the first step it is loading the whole database like functions, procs, and tables and it might break the power bi file. But my problem is that I wanted to only load filtered table not full database. muneer.pngmuneer 2.png

View solution in original post

7 REPLIES 7
Wani_Muneer
Helper I
Helper I

Thank you very much 😀😀😀

Wani_Muneer
Helper I
Helper I

Hi, @Daryl-Lynch-Bz Thanks for the Reply,

        Yes I want to Load tables Separately

 

 

The simpliest way it two create Query that connects to the Database, then filter text.  

let
    Source = Sql.Databases("Server", "Database"),
    #"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Item], "a") or Text.StartsWith([Item], "A"))
in
    #"Filtered Rows"

You will be left with a list of tables starting with a or A.  Note Power Query is case sensitive.

 

Next you can use the "Add as New Query" to open each table separately and load them to Power BI.

 

DarylLynchBzy_0-1670415762374.png

 

Otherwise you might try the search feature in the Navigator Screen when connecting to the database.  But this more of a wildcard search than start with, and would include the schema table as well.

DarylLynchBzy_1-1670416050306.png

 

 

@Daryl-Lynch-Bzy But at the first step it is loading the whole database like functions, procs, and tables and it might break the power bi file. But my problem is that I wanted to only load filtered table not full database. muneer.pngmuneer 2.png

Note the first step is not loading the database, it is viewing the metadata about the database.  You can filter this view by using any columns (except for the [Data] column).  This Query (i.e. Query13) can be stored excluded from Load. 

 

When you click on the blue Table in the [Data] column, it will load that table into Power Query or Power BI.  

 

Given the number of names on the images above, it may not be effective to Load them individually in separate queries.  Especially, if the underlying tables are the same.  Do the underlying tables have a column with the Table Name?

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @Wani_Muneer - yes, but it depends what you mean by load.  Do you want to load each one separately or do you want to combine these tables into a single table?

we want to load each table separately.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors