Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello - I'm stumped finding the date difference between nonconsecutive rows, grouped by category. ProjectID is the "category", I need to caculate the time in between the previous record and a newly created record is that has the same ProjectID.
Any help is greatly appreciated.
Latest Attempt Using DAX:
My concern is the PreviousDate value isn't finding the corresponding ProjectID.
Thanks in advance!
Hey @Fantastic_Raab ,
you can either do that already in Power Query:
Value from previous row – Power Query, M language – Trainings, consultancy (exceltown.com)
Or you can do that in DAX. Ther you could use EARLIER, what is not recommended, or what I usually prefer is to do it with variables. You find both approaches in the following article:
Cracking DAX – the EARLIER and RANKX Functions - Simple Talk (red-gate.com)
Then you just have to calculate the date difference between the two values with the DATEDIFF function and you got your result.
Hi Selimovd -
Regarding the suggestion to add the previous value: I'm not sure how to grab the previous value from the same ProjectID. And the ProjectID is not static, there will be new ones regularly. Though I think the PowerQuery is the way to go:
I am cautoius about using the EARLIER function. The article suggests serious lag time due to number of operations.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
42 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
46 | |
31 | |
30 | |
18 | |
18 |