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
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 🙂
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 🙂
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 🙂
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? 

Highlighted
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 🙂
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.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 265 members 2,381 guests
Please welcome our newest community members: