cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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 IV
Super User IV

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 🙂
Feel free to email me with any of your BI needs.





View solution in original post

20 REPLIES 20
Super User IV
Super User IV

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 🙂
Feel free to email me with any of your BI needs.





Microsoft Phil_Seamark
Microsoft

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!

Highlighted
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 IV
Super User IV

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 🙂
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 IV
Super User IV

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 🙂
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
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors