Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Can anybody help me?
I need to create a filter on Power Query with the last 60 days, considering the current date. Thanks.
Solved! Go to Solution.
Hi @Syndicate_Admin ,
According to your description, here's my solution. Add a new step in Advanced editor.
Table.SelectRows(#"Changed Type", each Duration.Days(Date.From(DateTime.LocalNow())-[Date])<=60)
Here's the whole code of my sample.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtI31DdUitWBcoyQOcbIHBNkjikyxwyZY47MsUDmWII4sQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
#"New"=Table.SelectRows(#"Changed Type", each Duration.Days(Date.From(DateTime.LocalNow())-[Date])<=60)
in
#"New"
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
According to your description, here's my solution. Add a new step in Advanced editor.
Table.SelectRows(#"Changed Type", each Duration.Days(Date.From(DateTime.LocalNow())-[Date])<=60)
Here's the whole code of my sample.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtI31DdUitWBcoyQOcbIHBNkjikyxwyZY47MsUDmWII4sQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
#"New"=Table.SelectRows(#"Changed Type", each Duration.Days(Date.From(DateTime.LocalNow())-[Date])<=60)
in
#"New"
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can use Date.IsInPreviousNDays
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
if you want to remove records > 60 days
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TchLCoAwDAXAu2TdB0nUti796xlK738NoYGQWU5rtFEiZVVwhWbqqdEeiq0OrwIpo06vDLW6QrHV7bVA6qjHa4ZavaHY6vOaICv1/gM=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Date", type date}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each Date.IsInPreviousNDays([Date], 60))
in
#"Filtered Rows"
If you want to remove records <60 days
then just put not
Table.SelectRows(#"Changed Type", each not Date.IsInPreviousNDays([Date], 60))
👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)
How to get your questions answered quickly -- How to provide sample data
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.