Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
= 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!
Solved! Go to Solution.
Well that was a schoolboy error!
Thanks a lot!
Remove the ) after #"Gas Day Executed"
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |