Forum Discussion
Anonymous
6 years agoNot applicable
Relative Date Filters for Last Days
I looked for some information on this but was not able to find anything and in an effort to save some time I figured I would ask here. I am working on a report where the source data is updated daily ...
- 6 years ago
I've run into enough minor or major issues with the relative date filtering, I've abandoned. it. I add a field to my Date Table in Power Query to give me a true or false. In your case, it would be:
= if Date.AddDays( DateTime.Date( DateTime.LocalNow() ) ,-1) = [Date] then true else falsePaste this entire section into a new Blank Query in Power Query in the Advanced editor and you'll see it. It will only show true for yesterday.
let Source = {Number.From(#date(2020,3,1))..Number.From(#date(2020,4,30))}, #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error), #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Date", type date}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Date.AddDays( DateTime.Date( DateTime.LocalNow() ) ,-1) = [Date] then true else false) in #"Added Custom"Only yesterday should show TRUE. Drop that in your filter and every refresh, it will update.
v-lionel-msft
6 years agoCommunity Support
Hi Anonymous ,
Set the [Date Range] option:
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.