Forum Discussion
Find previous date based on single date per record.
Hello Power BI Community
I need your help. What I want to do is compare the current row data and find the previous date a case was submitted for the same account number. If the data is the 1st case created then just have that created date be the previous date.
While searching the Community forum, I have come across different methods using Indexes, Min, and even Minx. I have tried those options and have not gotten the desired outcome. The closest calculation I have found is. What am I missing?
CALCULATE(MIN(Case[Created_Date]),Filter(Case, Case[ID] = EARLIER(Case[ID])))
Month Acct Num Case_Num Created_Date ID Previous Case (Desired Outcome)
| Sep-20 | 150023308 | 110467641 | 9/2/2020 12:37 | 1500233080000100 | 9/2/2020 12:37 |
| Sep-20 | 150023308 | 110642457 | 9/4/2020 14:54 | 1500233080000100 | 9/2/2020 12:37 |
| Sep-20 | 290333510 | 111022070 | 9/11/2020 17:24 | 2903335100000100 | 9/11/2020 17:24 |
| Sep-20 | 150011871 | 111082621 | 9/14/2020 13:18 | 1500118710000100 | 9/14/2020 13:18 |
| Sep-20 | 290333510 | 111299157 | 9/16/2020 18:17 | 2903335100000100 | 9/11/2020 17:24 |
| Sep-20 | 150011871 | 111346674 | 9/17/2020 13:13 | 1500118710000100 | 9/14/2020 13:18 |
| Sep-20 | 290333510 | 111522973 | 9/21/2020 16:23 | 2903335100000100 | 9/16/2020 18:17 |
| Sep-20 | 150011871 | 111751337 | 9/23/2020 20:59 | 1500118710000100 | 9/17/2020 13:13 |
Jorgast , Previous date as a new column
MAXX(Filter(Case, Case[ID] = EARLIER(Case[ID]) && Case[Created_Date] <earlier(Case[Created_Date])),Case[Created_Date])
1 Reply
- amitchandak
Super User
Jorgast , Previous date as a new column
MAXX(Filter(Case, Case[ID] = EARLIER(Case[ID]) && Case[Created_Date] <earlier(Case[Created_Date])),Case[Created_Date])