Forum Discussion
maneschr2022
3 years agoHelper 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 transf...
- 3 years ago
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
ppm1
3 years agoSolution 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