I have a question about how to calculate datediff between rows. I have dataset like below:
What I need is a calculated column where datediff (MIN or HOUR) between each row is calculated (from the very beginning).
Something like the outcome below (based on my example):
Could you please help me with that?
Go to Solution.
After my test, you could do these follow my steps as below:
Add a group rank column
group rank = RANKX(FILTER(Table1,Table1[Trackingtocken]=EARLIER(Table1[Trackingtocken])),Table1[createdon],,ASC)
Use EARLIER Function add a datediff column
Datediff = DATEDIFF(CALCULATE(MAX(Table1[createdon]),FILTER(Table1,Table1[Trackingtocken]=EARLIER(Table1[Trackingtocken])&&Table1[group rank]=EARLIER(Table1[group rank])-1)),Table1[createdon],MINUTE)
here is pbix, please try it.
View solution in original post
See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...
Proud to be a Datanaut!
Thanks a lot! I will test your approach.
Thank you very much, it worked for me :).
We're rolling out new Kudos Given badges. Find out how many Kudos you've given.
Find out where you can attend!