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 filter some records that have a date/time field but I only want the ones that have occurred in the last 20 hours. Any idea on how I can filter that in power query? Thanks.
Solved! Go to Solution.
Hello @mklevemann
Assuming your table has Timestamp or Date/time column that looks like below
Click 'fx' to 'Add Step', and use below M code (but remember to replace ' Source ' to the name of your previous step, my last step in below picture is ' #"Changed Type" ' and [EventTimestamp] to your actual date/time Column)
= Table.SelectRows(Source, each [EventTimestamp] >= DateTime.LocalNow() - #duration(0, 20, 0, 0))
Hope this helps:)
Hello @mklevemann
Assuming your table has Timestamp or Date/time column that looks like below
Click 'fx' to 'Add Step', and use below M code (but remember to replace ' Source ' to the name of your previous step, my last step in below picture is ' #"Changed Type" ' and [EventTimestamp] to your actual date/time Column)
= Table.SelectRows(Source, each [EventTimestamp] >= DateTime.LocalNow() - #duration(0, 20, 0, 0))
Hope this helps:)
Thanks!
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 |
|---|---|
| 9 | |
| 7 | |
| 7 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 22 | |
| 14 | |
| 11 | |
| 10 | |
| 9 |