Forum Discussion
Using a list query as parameter file for dynamic table filtering
" parameter DataPullEndDate which derives its value from ReportEnddate"
How? You can overwrite parameters at runtime, but you cannot store that change in Power Query. Power BI has no memory of its own activities. Anything memory related has to happen outside of Power BI, for example with a second query where you fetch that ReportEndDate from the data source.
You can simplify your query a bit:
let
Source = Sql.Database("ebhreportingdev-dw.database.windows.net", "ebhreportingdw"),
dw_dimDate = Source{[Schema="dw",Item="dimDate"]}[Data],
#"Renamed Columns" = Table.RenameColumns(dw_dimDate,{{"calDate", "Date:"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "calDayNo", each Date.Day([#"Date:"])),
#"Filtered Rows1" = Table.SelectRows(#"Added Custom", each [#"Date:"] >= DataPullStartDate and [#"Date:"] <= DataPullEndDate)
in
#"Filtered Rows1"
Thank you for your response. A quick solution to the issue would be answered as below:
In this line:
#"Filtered Rows1" = Table.SelectRows(#"Added Custom", each [#"Date:"] >= DataPullStartDate and [#"Date:"] <= DataPullEndDate)
What M query syntax will allow me replace param DataPullStartdate with list value ReportstartDate and param DatapullEndDate with list value ReportEndDate? In that case I wont need the param files after replacing with the list values.
Those list values are from a backend table.
Using paran files does not solve my proble as the list values do not autiomatically populate the param files. I intend to apply those values to dynamically filter my DimDate without having to change the param values in Desktop.
Thank you for your usual quick response.
- lbendlin5 years agoSuper User
Not sure why you want to use lists for single values, but in that case you need to say List.First() to get to the value