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
zettipasta
Regular Visitor

Duplicates from a 4-hour interval w/ different datetime

Hello everyone! I have asked the same type of question but I can't figure out how to tweak the DAX function wherein the ID from a previous datetime will be tagged as HOLD if it enters today's datetime.

 

zettipasta_1-1666657997517.png

 

This previous discussion is for your reference: How to get duplicates from a 4 -hour interval - Microsoft Power BI Community

2 REPLIES 2
amitchandak
Super User
Super User

@zettipasta , I think you need additional date column for that

 

date = datevalue([Datetime])

 

New column =

var _time = [DateTime] -time(4,0,0)

var _cnt =countx(filter(Table, [ID] = earlier([ID]) && [DateTime]>= _time && [DateTime]< earlier([Datetime]) && [date] = earlier([date]) ), [ID])

var _cntall =countx(filter(Table, [ID] = earlier([ID]) && [DateTime]< earlier([Datetime]) && [date] = earlier([date])  ), [ID])

return

Switch(True(),

not(isblank(_cnt)), "Hold",

isblank(_cnt) && not(isblank(_cntall)), "Release",

"Hold"

)

 

If the old one is helping, mark that as a solution.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I did add an additional column for the date, but the output that I desire is that when the same id e.g., ID 1 from 10/24 at 8pm enters the latest datetime, it would still be tagged as hold

zettipasta_0-1666677483713.png

Although the 4-hour interval works, it doesn't count for across dates but only for the current datetime.. The ID is released at 12am when it should still subtract the hour, making it at 8pm, still tagging it as hold. 

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.