Forum Discussion
nrqz
2 years agoFrequent Visitor
Dynamic Filter on a Date/Time Column?
I have a report in Power BI desktop. I'm trying to setup a dynamic filter on a date/time column that pulls in the past 8 hours worth of data based on the time when the report gets refreshed/reloaded....
- 2 years ago
in Power Query you need to use the old school #duration(0,8,0,0)
DateTime.LocalNow()-duration(0,8,0,0)
nrqz
2 years agoFrequent Visitor
Ok, I'm starting to figure this out. Currently I've been playing with the query below to try to get this to work:
= Table.SelectRows(Source, each ([TimeStamp_field] = null or [TimeStamp_field] > DateTime.LocalNow()-8/24))
But there's something wrong with the second half of that where I'm trying to subtract 8 hours from the current time. I'm getting this error message:
Any idea how I can fix my code above?
lbendlin
2 years agoSuper User
in Power Query you need to use the old school #duration(0,8,0,0)
DateTime.LocalNow()-duration(0,8,0,0)