Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mrbuttons07
Helper II
Helper II

Filter Data to show current date but with time condition

Hello everyone,

I have a set of data that shows transactions performed. The dataset shows data up to 7 days. I'm trying to achieve a workaround in Power Query where I would like to filter the data to show current date. However, it should come with a condition whereby the day starts at 0645am and ends on 0645am the following day (24 Hours). So technically, the data should show transactions performed on 17th August 2021 (Current day) which starts at 0645am and ends at 0645am the following day. I could only filter the data to show the current day but to enforce such condition, I'm unable to find the solution. 

I have attached the excel file test in the link given. Thank you very much for your help and support!

https://1drv.ms/u/s!AiNw1b4HnMZOwn_C66E5-wJeHWkc?e=FkkWtR

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

You can use syntax like this in your filter step.  Just create any datetime filter step on that column using the "Between" option, and then adapt the code to match the bold part.

 

= Table.SelectRows(#"Changed Type", each [Tasklist Signoff Date and Time] >= Date.AddDays(Date.From(DateTime.LocalNow()), -1) & #time(6,30,0) and [Tasklist Signoff Date and Time] <= Date.From(DateTime.LocalNow()) & #time(6,30,0))

 

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Employee
Employee

You can use syntax like this in your filter step.  Just create any datetime filter step on that column using the "Between" option, and then adapt the code to match the bold part.

 

= Table.SelectRows(#"Changed Type", each [Tasklist Signoff Date and Time] >= Date.AddDays(Date.From(DateTime.LocalNow()), -1) & #time(6,30,0) and [Tasklist Signoff Date and Time] <= Date.From(DateTime.LocalNow()) & #time(6,30,0))

 

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors