cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Giavo Regular Visitor
Regular Visitor

DATEDIFF between Rows and GROUP BY

Hello everybody. 2 DAX Questions about DATEDIFF.

1)I need to find the difference in minutes between the rows of "DateTime" column

2)I need to find the difference in minutes between the rows of "DateTime" column GROUPING BY "IWC Number"

 

Can you please help me with DAX ?

Cattura.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: DATEDIFF between Rows and GROUP BY

here is the output i see on my end from your data

m.PNG






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





View solution in original post

20 REPLIES 20
Super User
Super User

Re: DATEDIFF between Rows and GROUP BY

when you said difference, you mean difference in minute from current row datetime to previous row datetime






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Phil_Seamark Super Contributor
Super Contributor

Re: DATEDIFF between Rows and GROUP BY

HI @Giavo

 

When you group by IWC number, what dates do you want to compare?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Giavo Regular Visitor
Regular Visitor

Re: DATEDIFF between Rows and GROUP BY

Yes exactly, difference(in minutes) between row and row+1(i guess i should use DATEDIFF but i can't obtain the correct result. 

 

Giavo Regular Visitor
Regular Visitor

Re: DATEDIFF between Rows and GROUP BY

after having the first formula (datediff between row and row+1), i would like to see if i can sum this Minutes(datediff) for each "IWC Number". thanks

Super User
Super User

Re: DATEDIFF between Rows and GROUP BY

do you mean difference between row and (row -1), not row + 1






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Giavo Regular Visitor
Regular Visitor

Re: DATEDIFF between Rows and GROUP BY

Isn't it the same thing? 

Giavo Regular Visitor
Regular Visitor

Re: DATEDIFF between Rows and GROUP BY

yes you're right. Row and Row - 1

Super User
Super User

Re: DATEDIFF between Rows and GROUP BY

@Giavo Man Happy

 

Can you paste the data so that i can use that for calc instead of the image you pasted, or share excel file (using google drive or other means). cheers!






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Giavo Regular Visitor
Regular Visitor

Re: DATEDIFF between Rows and GROUP BY

yes sure, thank you for helping

 

ProgressiveIndexIWC NumberDateTimeStatus
110013/10/17 7:101
210013/10/17 9:043
310013/10/17 9:103
110313/10/17 9:182
210314/10/17 9:215
310314/10/17 9:317
110614/10/17 9:5031
210614/10/17 10:0921
310614/10/17 11:0243

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 142 members 1,762 guests
Please welcome our newest community members: