Forum Discussion
Using Date as VAR and Parameter Advanced Editor
- 4 years ago
Anonymous wrote:
I have currently used manual dates, how do I set the [Notification Date] >=StartDate and [Notification Date] <=EndDate
As long as the variables are the same data type if should work exactly as you have it in your psuedo code.
eg.
Let StartDate = StartOfPeriodx, EndDate = EndOfPeriodx, Source = Parquet.Document(File.Contents("\\notifs.pq")), #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each [Notification date] >= StartDate and [Notification date] <= EndDate)
Anonymous wrote:
Yeah I guess it is a date format issue then.
No, I was talking about Data Types (eg. Date vs DateTime vs DateTimeOffset), but it looks like you are using a DateTime here so that is probably not the issue. (although DateTime.LocalNow could be a problem depending on where you run your data refresh from. If you refresh on the Power BI Service the Date Time will be in UTC time, if you refresh on a Report Server the time will depend on the timezone setting on the server)
Anonymous wrote:
I believe it's only the EndDate giving me an error.
This is the first time you've mentioned seeing an error. What is the text of the error message?
Cheers mate, The previous way worked. It kept getting timed out as the date range was over a year.