Forum Discussion

setis's avatar
setis
Post Partisan
7 years ago
Solved

Latest value from another table

Dear all,   There are several topics about finding the latest value but I can't get it working for me.   I have a [Cases] table with the columns "CaseID" and "CreatedOn" (Date&time)   and a sec...
  • AlB's avatar
    AlB
    7 years ago

    Hi setis

    Try this:

     

    1. Create these three measures:

     

    ResolutionDate = MIN(CaseResolutionL[CreatedDate])
    PaymentDate = MAX(Payments[Posting Date])
     
    ReimbursementDate =
    CALCULATE (
        VALUES ( Reimbursements[Posting Date] );
        Reimbursements[Remaining Amount] = 0
    )

    2. Then you can create other measures combining the ones above. For instance, according to your description above: 

    Days1to2 = SELECTEDVALUE(CasesL[CreatedOn]) - [PaymentDate]

    Days2to3 = [PaymentDate] - [ResolutionDate]

    Days3to4 = [ReimbursementDate] - [PaymentDate]

     

    3. Place CasesL[CaseId] in the rows of a matrix visual and the measures above in values of the matrix

     

    I think it would be good to review the tables for consistency as right now you seem to have, for example, Ids in the Resolutions table that do not appear in CasesL