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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.