Forum Discussion
lbrumer
9 years agoRegular Visitor
How to pass the date parameters in PQ Query?
Please let me know if the following future is available in Power BI: Dynamically pass date as parameter to stored procedure.
- 9 years ago
Hi lbrumer,
With the Query Parameters feature, we can define one or multiple parameters to be used in the queries, Data Model and report layers in Power BI Desktop.
For example, to pass the date parameters in PQ Query, you can create a new Query Parameter of Date, then use this date parameter to filter your corresponding date column in the Query like below. For more details about POWER BI DESKTOP QUERY PARAMETERS, you can refer to this article. :smileyhappy:
let Source = Sql.Databases(""), AdventureWorksDW2012 = Source{[Name="AdventureWorksDW2012"]}[Data], dbo_DimDate = AdventureWorksDW2012{[Schema="dbo",Item="DimDate"]}[Data], #"Filtered Rows" = Table.SelectRows(dbo_DimDate, each [FullDateAlternateKey] > DateParameter) in #"Filtered Rows"Regards
ashraf_K
3 years agoFrequent Visitor
Hello,
Is there a way to give the user the ability to choose the date instead of hard coding it?
Regards.
SaqibRashid
1 year agoNew Member
Were you able to find a way to choose instead of hard coding?