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

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

Reply
Anonymous
Not applicable

Get Date difference with minutes if possible between first occurrence and last occurrence.

In the screenshot attached A has occurred four times and first occurrence is on 01/01/2020 11:20 and last occurrence is 03/01/2020 11:29. So the date difference between these two is 2 days 9 minutes. (1449 min). Calculation difference in hours or in muntes or in seconds will also work.

 

DateDiff.PNG

I need result table in Power like 

A  1449

B  X

C  X..

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Came to know later that simple below measure will also work
DateDiff in Hours = DATEDIFF(MIN(B),MAX(B),HOUR)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Came to know later that simple below measure will also work
DateDiff in Hours = DATEDIFF(MIN(B),MAX(B),HOUR)

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try this measure:

 

Measure = 
VAR Min_ = 
CALCULATE(
    MIN(Sheet4[Date/time]),
    ALLEXCEPT(
        sheet4, Sheet4[Item]
    )
)
VAR Max_ = 
CALCULATE(
    MAX(Sheet4[Date/time]),
    ALLEXCEPT(
        Sheet4, Sheet4[Item] 
    )
)
RETURN
Measure 2 = 
DATEDIFF(
    [Min_], [Max_], MINUTE
)

iii9.PNG

2 days 9 mins = 24*60*2 + 9 = 2889

 

 

Best regards,
Lionel Chen

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


 

amitchandak
Super User
Super User

You have view data based on column 1

and create a measure to take diff

 

measure = datediff(Min(Table[Date]),Max(Table[Date]),Minute)

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
Greg_Deckler
Community Champion
Community Champion

DATEDIFF([Date1],[Date2],MINUTE)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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