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
Anonymous
Not applicable

How to count based on last 5 date columns?

Hello,

I have 2 columns valid to and valid from, i want to have column that will count Number column where Forklit is between 5 and 10, but  at certain time, at 6, 12 and 14:35, so basically I need to group date columns for every 5 records in every 5 minutes 
Something like this but without fixed date:
where valid_from <= to_date('20220831060000', 'YYYYMMDDHH24MISS') and valid_to > to_date('20220831060000', 'YYYYMMDDHH24MISS')

anasamardzic23_0-1662640758918.png

I should be able to see at the end this table:

anasamardzic23_2-1662641158544.png
Count of number from 06:00-06:05, then from 12:00-12:05 and from 14:35-14:40 for the last 2 days

Can someone help me with this please? 🙂

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

I'd like to suggest you add a calculated column to check the time value part of two DateTime fields to setting groups. That you can simply use the group to summary records.

You can also take a look at the following blog about segmentation if helps:

Static segmentation – DAX Patterns

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous,

I'd like to suggest you add a calculated column to check the time value part of two DateTime fields to setting groups. That you can simply use the group to summary records.

You can also take a look at the following blog about segmentation if helps:

Static segmentation – DAX Patterns

Regards,

Xiaoxin Sheng

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.