Forum Discussion
Krlos5411
1 year agoFrequent Visitor
Compare two dates in different lines for same ID
Hi All, I need to calculate the time between the CREATE status and the APPROVAL status for every ticket that has those stages. There's some tickets that has no APPROVAL status for example. So I ...
- 1 year ago
Hi Krlos5411
Would a measure like this work?
Days from Created to Approval = VAR _CurrStatus = SELECTEDVALUE('Table'[Status]) VAR _Create = CALCULATE( MIN('Table'[Due Date]), ALL('Table'[Due Date]), 'Table'[Status] = "CREATE" ) VAR _Approval = CALCULATE( MAX('Table'[Due Date]), ALL('Table'[Due Date]), 'Table'[Status] = "APPROVAL" ) VAR _Result = IF( NOT ISBLANK(_Approval) && _CurrStatus = "APPROVAL", DATEDIFF(_Create, _Approval, DAY) ) RETURN _ResultLet me know if you have any questions.
Days from Created to Approval.pbix
Krlos5411
1 year agoFrequent Visitor
Hi gmsamborn ,
this is the link to my onedrive with the sample
PBIX Sample
3. What I'm lookinf for is to have an average of days that took from Create stage to Approval for all the tickets that has those stages. They are several, not just one.
The first calculation that you sent, works for the calculations indeed, but it doesn't works if I need to have the total average of all the tickets.
Thanks in advance for your assistance!!