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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
javedbh
Helper II
Helper II

Import new tables of a sql server database in power bi automatically

I have a sql server database. Some tables are fixed but most of the tables are created at runtime by a desktop application based on the files received. These files contain test results which are saved in these tables. The number and names of the columns of these tables can vary and most likely number/names of columns in one table don’t match those of a different table. The application might create two tables today and create a few more tables a few days later. The information that which table was created for which data is also stored in a mapping table so I can get a list of the tables.

 

I want to add these tables in power bi automatically. Is this possible? or any other idea how to use them in power bi?

1 REPLY 1
ImkeF
Super User
Super User

You can use parameters in your SQL-queries: http://www.excelguru.ca/blog/2016/04/28/pass-parameters-to-sql-queries/

But one query in the query editor can just return one table. So what you cannot do is to create x different queries/tables at once. If you want to consolidate your multiple tables into one, that's possible. Pls let me know & I will tell you how to achieve this.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.