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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
dimmark995
Regular Visitor

Import sql database tables in a dynamic way

Hi Team,

I have the following problem. Lets say i have stored my tables in a SQL server with the following names (Sales_April2024, Sales_May2024, Expenses_April2024, Expenses_May2024 etc. My goal it to allow the end user select from two slicers the Month and Year. This will result in a refresh of tables (and visuals as a result) from the sql database based on month and year. The steps i took were the following                                                                        1) Created two parameters for Month and Year                                                                                                                                        2) Created the following queries for fetching the tables based on the parameter valuesΣτιγμιότυπο οθόνης 2024-07-16 234616.png

 

Στιγμιότυπο οθόνης 2024-07-16 234930.png

    

  When i change the parameter from April to May from "Edit Parameters" it seems to work but i want an automated solution

 

Thanks in advance                                                                                                                     

1 REPLY 1
Anonymous
Not applicable

Hi @dimmark995 

You can consider to use dynamic paramaters, it allows user to change the patamater value by selecting the value in slicers, but it is only support in direct query mode, you can refer to the following link about it.

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.