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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
georgec96
Helper II
Helper II

Time filtering

Hi everyone 

 

I have a transaction table with a few million rows and a date&time column that contains records for several days.

 

Because the data gets pulled at a random time, some of my records in the table are not a full day worth of data.

 

I am looking for a way to filter my data to only include full days records i.e. 24 hrs ( 6 AM TO 6 AM) for every day in the table.

 

Any help is much appreciated 

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

I agree you should split your DateTime into Date and Time columns (best practice). You could then add a custom column that returns 1 if the Date is today ( Date.From(DateTime.LocalNow()) ) and the hour is >=6, and 0 if not. You can then filter away the 1s.

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


v-angzheng-msft
Community Support
Community Support

Hi, @georgec96 

Could you please consider sharing more details about it and posting expected result so it is clear on what needs to be implemented?  And It would be great if there is a sample file without any sesentive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar
  2. Expected output from sample data
  3. Explanation in words of how to get from 1. to 2.

 

 

Best Regards,
Community Support Team _ Zeon Zheng

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HotChilli
Super User
Super User

I think you can construct a new column (adjusted day) which would be a date format (not datetime) and something like:

if hour is less than 6 then subtract 1 day from the date of date&time column else date of date&time

Any idea how to go about writing that formula in Power Query?


I just started working in Power BI not long ago and I'm not that familiar with the language.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.