Forum Discussion
filter fact table using parameter power bi
Hi rajendraongole1 ,
can it be possible to create date parameters in power query and filter the sales fact table based on that parameter?
Hi powerbiexpert22 - Yes, it is possible with Manage parameter option in Power query editor too
Manage Parameters -> New Parameter
create StartDate with Date data type provide a default value . EndDate another paramter Date and provide a default value.
Near to the M Code:
let
Source = (StartDate as date, EndDate as date, SalesTable as table) as table =>
let
FilteredTable = Table.SelectRows(SalesTable, each [OrderDate] >= StartDate and [OrderDate] <= EndDate)
in
FilteredTable
in
Source
Hope it helpful, Try the above approach if you required to implement in PQ.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!