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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I am trying to create a date filter to exclude items where the date is greater than today - 150 days.
Based on some research, I have come up with the below; however, it is excluding Today!
Any help would be greatly appreciated
= Table.SelectRows(#"Sorted Rows", each Date.IsInPreviousNDays([Finish Date], 150) or Date.IsInNextNDays([Finish Date], 1000))
Solved! Go to Solution.
I'm a bit confused. You want to exclude rows wheer the date is greater than today -150? But your code keeps those rows?
Your code will exclude today because today falls inside yoru exclusion criteria. Today's date is greater than today - 150 days.
To keep rows where the date is greater than today -150
= Table.SelectRows(#"Sorted Rows", each Date.IsInPreviousNDays([Finish Date], 150) or [Finish Date] = Date.From(DateTime.LocalNow()))
To exclude these rows
= Table.SelectRows(#"Sorted Rows", each not (Date.IsInPreviousNDays([Finish Date], 150) or [Finish Date] = Date.From(DateTime.LocalNow())))
Phil
Proud to be a Super User!
Hi Phil,
Yes - apologies for my clumsiness - I was trying to exclude items that were less than today -150, i.e. only show items that had a date greater than today - 150 days.
Your code helped me, but for some reason excluded items after today. I adapted your code and to the below and now have the result I need.
Thanks for the help
= Table.SelectRows(#"Sorted Rows", each Date.IsInPreviousNDays([Finish Date], 150) or [Finish Date] = Date.From(DateTime.LocalNow()) or Date.IsInNextNDays([Finish Date], 900000) )
Hi Phil,
Yes - apologies for my clumsiness - I was trying to exclude items that were less than today -150, i.e. only show items that had a date greater than today - 150 days.
Your code helped me, but for some reason excluded items after today. I adapted your code and to the below and now have the result I need.
Thanks for the help
= Table.SelectRows(#"Sorted Rows", each Date.IsInPreviousNDays([Finish Date], 150) or [Finish Date] = Date.From(DateTime.LocalNow()) or Date.IsInNextNDays([Finish Date], 900000) )
I'm a bit confused. You want to exclude rows wheer the date is greater than today -150? But your code keeps those rows?
Your code will exclude today because today falls inside yoru exclusion criteria. Today's date is greater than today - 150 days.
To keep rows where the date is greater than today -150
= Table.SelectRows(#"Sorted Rows", each Date.IsInPreviousNDays([Finish Date], 150) or [Finish Date] = Date.From(DateTime.LocalNow()))
To exclude these rows
= Table.SelectRows(#"Sorted Rows", each not (Date.IsInPreviousNDays([Finish Date], 150) or [Finish Date] = Date.From(DateTime.LocalNow())))
Phil
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 10 | |
| 9 | |
| 6 | |
| 5 | |
| 3 |