Forum Discussion
Anonymous
3 years agoNot applicable
Last 7 Days Data Based on a Parameter
= Table.SelectRows(#"Set Data Types", let latest = List.Max(#"Set Data Types"[Gas Day]) in each ([Gas Day] <= latest) and ([Gas Day] >= Date.AddDays(latest,- 7) ))
Hi All
I found the above code to filter my date field in Power Query for the last 7 days in my data
What I would like to do is change that to the last 7 days from the date set in a Parameter
I have got as far as creating a Parameter called Gas Day Executed On and placed it in my code below
= Table.SelectRows(#"Set Data Types", let latest = #"Gas Day Executed") in each ([Gas Day] <= latest) and ([Gas Day] >= Date.AddDays(latest,- 7) ))
This gives me an error
Can any help me get this working, much appreciated!
Remove the ) after #"Gas Day Executed"
2 Replies
- artemusMicrosoft Employee
Remove the ) after #"Gas Day Executed"
- AnonymousNot applicable
Well that was a schoolboy error!
Thanks a lot!