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
EZiamslow
Helper III
Helper III

Distinct count if the date is less than 24 hr for duplicate ID

I'm trying to distinct count ID column if the date is less than 24 hrs otherwise count duplicate. The table below I want it to count all green color only. 

DateID Time(delta)
7/19/19 10:51 PM131845  
7/19/19 3:51 AM131845 0.791666667
7/18/19 10:11 PM131845 0.235601852
7/17/19 9:41 PM131450 1.02086015
7/17/19 9:35 PM131450 0.004670174
7/17/19 9:22 PM131492 0.00852735
7/17/19 9:17 PM131659 0.003348495
7/17/19 12:52 AM131659 0.850702049
7/17/19 12:11 AM131455 0.02858735
7/16/19 1:20 AM131659 0.95201809

I like to see that data table as below for count.

 

DateCount
7/19/20192
7/18/20190
7/17/20194
7/16/20191
4 REPLIES 4
Anonymous
Not applicable

Hi @EZiamslow 

There are many ways to achieve the solution.

Can you explain the time column? What is 24 hours?

Cheers!
A

Actually, I want to see the count as this table. 24hrs between same ID row. For example, the top two rows has 1.11 days so I like to count both rows. If less then 24 hrs, I like to count as 1.

Anonymous
Not applicable

Hey @EZiamslow 

Please provide the logic behind your solution.

It is hard to guess.

Cheers!
A


@Anonymous 

It's similar to distinct count. If Date/Time between IDs are within 24hrs, count as 1. If Date/Time between IDs are more than 24hrs, count all duplicates.

 

Edited: I updated the table

 

Thanks

 

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors