Forum Discussion
inonb
6 years agoFrequent Visitor
dyanmic date parameters
Hi i have a report of ssrs, this is the query i want to implement it in power bi, i mean the parameter of dates SELECT * FROM TableA WHERE [Date] >=@StartApproveddate AND [Date]<=CASE WHEN ...
inonb
6 years agoFrequent Visitor
thanks of reply
Can you send me link of example
JirkaZ
Solution Specialist
6 years agoinonb First of all you have to create the start and end date parameters in query editor (of DATE type).
Then the query itself would look something like:
let
EndDateDW = Date.DayOfWeek(EndDate),
EndDateAdjusted = if (EndDateDW = 4 or EndDateDW = 5) then Date.AddDays(EndDate, EndDateDW - 1) else Date.AddDays(EndDate, 2),
//Now you can use the StartDate and EndDate params in your query
Source = ""
in
Source