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 LauraH9274 - I believe you need to convert the date to text in Power Query and then pass that back to your source, such as in the example below.
Date.ToText ( ParameterStartDate, "yyyy-MM-dd" )
When you it worked for you as a text value, was that for some other field or passing the date as text? Where did you have that placed in the script? Was it in the source step or in one of the later steps like your date filter? When you use the query as you currently have it configured, what happens? Nothing? An error? What error?