Forum Discussion

awff's avatar
awff
Helper III
4 years ago
Solved

Creating a latest occurrence column

Hello fellow PBI'ers,   I am hoping to create a calculated column which identifies the latest occurrence with each account based on a few criterias. The result is as per the "Desired_Result" column...
  • FarhanAhmed's avatar
    4 years ago

    Try this

     

     

    _Latest Result Column= 
    
    Var Acc = 'Latest Occurence'[AccountName]
    Var Pro = 'Latest Occurence'[Product]
    Var dt = CALCULATE(MAX('Latest Occurence'[EndDate  ]),FILTER('Latest Occurence','Latest Occurence'[AccountName]=Acc && 'Latest Occurence'[Product]=Pro && 'Latest Occurence'[Family]="Maintenance"))
    
    RETURN
    IF(dt='Latest Occurence'[EndDate  ] && 'Latest Occurence'[Family]="Maintenance","Latest","")