Forum Discussion
Getting Max Date tied to specific ID
I have a list of Tracking ID's with respective Assessment ID's. The tracking ID is the same but a different assessment ID for each tracking ID. We use the same create date and tracking completion date, but each assessment can be completed on a different date (see below).
| Tracking ID | Assessment ID | Date Create | Tracking Comp | Assessment Comp |
| 548794 | 11001 | 9/1/2021 | 9/30/2021 | 9/5/2021 |
| 548794 | 11002 | 9/1/2021 | 9/30/2021 | 9/28/2021 |
| 548794 | 11003 | 9/1/2021 | 9/30/2021 | 9/17/2021 |
| 451265 | 10554 | 9/15/2021 | 10/27/2021 | 9/17/2021 |
| 451265 | 10055 | 9/15/2021 | 10/27/2021 | 10/1/2021 |
| 451265 | 10056 | 9/15/2021 | 10/27/2021 | 10/20/2021 |
| 451265 | 10057 | 9/15/2021 | 10/27/2021 | 9/30/2021 |
| 451265 | 10058 | 9/15/2021 | 10/27/2021 | 9/30/2021 |
| 451265 | 10059 | 9/15/2021 | 10/27/2021 | 10/7/2021 |
| 451265 | 11785 | 10/7/2021 | 12/1/2021 | 11/30/2021 |
| 451265 | 11786 | 10/7/2021 | 12/1/2021 | 10/28/2021 |
| 451265 | 11787 | 10/7/2021 | 12/1/2021 | 10/29/2021 |
| 451265 | 11788 | 10/7/2021 | 12/1/2021 | 11/7/2021 |
I need to figure out a way to determine what the Max Assessment Date is for each Tracking ID (see below).
| Tracking ID | Assessment ID | Date Create | Tracking Comp | Assessment Comp |
| 548794 | 11002 | 9/1/2021 | 9/30/2021 | 9/28/2021 |
| 451265 | 10056 | 9/15/2021 | 10/27/2021 | 10/20/2021 |
| 451265 | 11785 | 10/7/2021 | 12/1/2021 | 11/30/2021 |
I have tried the MAX formula, but since we need to use it respectively back to a tracking ID, I only get the max date of (for example) yesterday.
- Anonymous4 years ago
Hi CA8172 ,
Create a measure and put it into the visual level filter. Set show items when the value is 1.
Measure = var _max=MAXX(FILTER(ALLSELECTED('Table'),[Date Create]=MAX('Table'[Date Create])),[Assessment Comp]) return IF(_max=MAX('Table'[Assessment Comp]),1)You can check more details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- DataInsights
Super User
Use this measure as a visual filter. In your sample data, did you mean to use three different Tracking ID?
Max Assessment Comp = VAR vMaxDate = CALCULATE ( MAX ( Table1[Assessment Comp] ), ALLEXCEPT ( Table1, Table1[Tracking ID] ) ) VAR vResult = IF ( MAX ( Table1[Assessment Comp] ) = vMaxDate, 1 ) RETURN vResult - freginier
Solution Sage
Create calculated column to assign flag and filter it
Flag = var maxAsses = CALCULATE( MAX(Table2[Assessment ]),FILTER(Table2,EARLIER(Table2[TrackingID])=Table2[TrackingID]&&Table2[Create] = EARLIER(Table2[Create]))) return if ( maxAsses = Table2[Assessment ],"X" ) - AnonymousNot applicable
Hi CA8172 ,
Create a measure and put it into the visual level filter. Set show items when the value is 1.
Measure = var _max=MAXX(FILTER(ALLSELECTED('Table'),[Date Create]=MAX('Table'[Date Create])),[Assessment Comp]) return IF(_max=MAX('Table'[Assessment Comp]),1)You can check more details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.