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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
maneschr2022
Helper II
Helper II

Dynamic M query parameters

Hi, does anyone have a pbix file to show me an example on how to reference in M query a dynamic M parameter to filter data based on Month-Year field?,

I have a datetime field, which I need to transform to Month-Year format, then I want to use it as a parameter so users are able to select a particular Month-Year in the slicer to display the data.

1 ACCEPTED SOLUTION

Yes I needed M dynamic query for better performance, but I resolved the question by myself using Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

View solution in original post

5 REPLIES 5
ppm1
Solution Sage
Solution Sage

If your direct query table doesn't have a column with values that match the ones in your YearMonth slicer, it isn't as straight forward. Two options:

1. Are you sure you need Dynamic M parameters? If you have a Date table with a relationship to your DQ table, your visual should create a query that includes the date values in that YearMonth.

2. In the query editor, you'll have to create min and max date values from your selected text YearMonth value. You can then filter your query by the min and max dates.

 

Pat

Microsoft Employee

Yes I needed M dynamic query for better performance, but I resolved the question by myself using Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

Hi, I'm looking for a solution here also, Issue I have is the sendign a a date Parameter, when you managed to solve your issue  did you happen to use a date parameter, would b goo dto see how you got that to work.  I am direct Query-ing Snowflake, I have made a data parameter I have made a filter to use for the parameter, but cannot seem to attch( Bind) it all together and get the correct date format.   Any help you can give here?

 

maneschr2022
Helper II
Helper II

Syndicate_Admin
Administrator
Administrator

What is your data source?  SQL server table?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.