Forum Discussion
Dynamic M Query Date Parameter Slicer Not Working
- 2 years ago
Okay LauraH9274,
Okay perfect.
Next you need a dynamic list of your Min and Max MIN_PAYLOAD_DATE Colum. This is the Code:
Name this query "MinPayloadDates"let // Step 1: Copy of Your Source Query Source = YourSourceQuery, // Step 2: Min und Max Date from Your Source Query MinDate = List.Min(Source[MIN_PAYLOAD_DATE]), MaxDate = List.Max(Source[MIN_PAYLOAD_DATE]), // Step 3: Liste der Daten erstellen DateListe = List.Dates(MinDate, Duration.Days(MaxDate - MinDate) + 1, #duration(1,0,0,0)) in DateListeNext you must edit your Parameter like this:
Now when you save and close you cand change the parameter in Power BI Desktop:Best regards from Germany
- Manuel
Hi jennratten , thanks for your response.
It worked on a text column, and the script was the same except for a different parameter and different column names.
The query at the moment is responsive to the parameter, so if i change the parameter manually to be a different date, this does filter the query, it just doesn't interact with the slicer in the report view. As soon as I add a slicer to the page, any visuals just go blank.
Not quite sure I understand what passing the date as text would do, as the slicer is still in a date format, could you elaborate please?
Much appreciated