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
JMAlloway
Helper I
Helper I

Help with parameter binding!

Hello, 

I am importing SQL data via direct query into my model. The SQL server creates a new database at the end of every calendar month. This creates monthly snapshots of our data. Each month database is named "yyyy-MM". I am using a query parameter that's binding to a single-row table that dynamically changes "yyyy-MM" based on the current date. My issue is that when I bind a parameter to the table value, it does not dynamically change to the expected value. Even when binding, the parameter value remains the original current value. Any advice on what I'm doing wrong or what step I'm missing? Thanks!

Parameter listed in M query:

JMAlloway_0-1676057340802.png

AD_YTD Parameter:

JMAlloway_1-1676057389332.png

Parameter table:

JMAlloway_2-1676057449729.png

Bind to parameter:

JMAlloway_3-1676057503596.png

 

 

 

2 REPLIES 2
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @JMAlloway  - I don't think this can work because you are effective changing the data source connection with the Dynamic M Parameter.  You could use the parameter to filter between tables within a database, but not to change between databases.

Thanks for the reply, Daryl! Maybe I'm thinking of this in the wrong way. I'm able to successfully pass a parameter value to the database name. If I manually change the parameter value and refresh, the change in database is successful. My issue is that I need the parameter value to change dynamically. For example, based on the current date, I need the parameter to display the last day of the previous month. (This is because the database is named the last day of each month). I'm thinking I should investigate creating a list query.

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.

Top Solution Authors
Top Kudoed Authors