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
RahulT01
New Member

Executing list of sql queries stored in database table

Hello Everyone,

 

I'm looking for an apporach to load data into Power BI from list of SQL queries stored in Postgres database table.

 

SrQuery
1Select ....
2Select ....
3Select ....
4Select ....

 

Essentially, we need to automate query loading process as list of query will increase/decrease with time & manual addition would not be permanent solution.

 

Any inputs if this can be achived & appreciate if you can share your experiences.

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @RahulT01,

I think you can try to parameterized connection string to achieve two steps getting data operation.

At the first, you can getting data from the SQL table that stored the t-SQL query lists. The second, you can use query parameters to control and pick up specific row values to use them as conditons in a new query step with data connector to getting data.

Deep Dive into Query Parameters and Power BI Templates | Microsoft Power BI Blog | Microsoft Power B...

Table.SelectRows - PowerQuery M | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @RahulT01,

I think you can try to parameterized connection string to achieve two steps getting data operation.

At the first, you can getting data from the SQL table that stored the t-SQL query lists. The second, you can use query parameters to control and pick up specific row values to use them as conditons in a new query step with data connector to getting data.

Deep Dive into Query Parameters and Power BI Templates | Microsoft Power BI Blog | Microsoft Power B...

Table.SelectRows - PowerQuery M | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

Do that in a view in your database, or use Incremental Refresh if your query partitions support that.

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.