Forum Discussion
Direct Query using Stored Procedure with a date/time parameter
- Anonymous1 year ago
Hi kurrysamir ,
Thanks for the update!
The issue is with the slicer style. When you use the "Between" style, even for a single date, Power BI treats it as a range filter, which is not supported for dynamic M parameters. Thats why switching to a drop-down works . It applies a direct, single-value filter, which is supported. Just make sure your slicer is set to List or Drop-down, and the field is from a proper date table.
If you would like to see support for single-date "Between" slicers in the future, feel free to suggest it on the Power BI Ideas forum. Feedback submitted through these channels is frequently reviewed by the product teams and can contribute to meaningful improvements.
Hope this helps.If so,consider accepting it as solution.
Regards,
Pallavi.
Hi kurrysamir ,
I wanted to check in on your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question.
Thank you.
Hi Pallavi,
Thanks for the response.
I am currenntly using table valued function and my M query looks like below:
let
Source = Sql.Database(Server, Database, [Query="SELECT * FROM [tableValuedFunction]('"&DateTime.ToText(DateTimeParameter)&"', NULL);"]),
#"Filtered Rows" = Table.SelectRows(Source, each true)
in
Source
Using this as a reference Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
The DateTimeParameter doesnt work on single Date Slicer(I managed to do by enabling the right slicer by slicer settings -> style set to Before), gives a warning saying,
Unsupported Filter ->This visual is producing a filter that's not supported for dynamic query parameters.
In the documentation its mentioned as the below are Unsupported filters :
But mine is not either
- Relative time slicer or filter
- Relative date
Its just a regular date filter. Can you please explain where am I incorrect here?
Also, tried changing the date slicer to a drop down and then it works, like the one below.
Thanks in advance,
Samir Kurry
- Anonymous1 year agoNot applicable
Hi kurrysamir ,
Thanks for the update!
The issue is with the slicer style. When you use the "Between" style, even for a single date, Power BI treats it as a range filter, which is not supported for dynamic M parameters. Thats why switching to a drop-down works . It applies a direct, single-value filter, which is supported. Just make sure your slicer is set to List or Drop-down, and the field is from a proper date table.
If you would like to see support for single-date "Between" slicers in the future, feel free to suggest it on the Power BI Ideas forum. Feedback submitted through these channels is frequently reviewed by the product teams and can contribute to meaningful improvements.
Hope this helps.If so,consider accepting it as solution.
Regards,
Pallavi.- kurrysamir1 year agoHelper I
Developed using the date drop-down instead of a date picker. Once I choose diferent dates, the direct query fires and gets the updated data. But, I have written in Power Bi Ideas forum to get the same working for a date picker as well.