Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate using filter

i have two tables    First table has a date where citations were issued. Second table has a date where officer was on a certain schedule.   The tables are joined by a unique ibm #    i am tryi...
  • johnt75's avatar
    4 years ago

    Create a calculated column on the Citation table

    Shift = 
    var offenseDate = Citations[Offense date]
    return SELECTCOLUMNS( TOPN( 1, 
       FILTER( RELATEDTABLE( Shifts ), Shifts[Start date] <= offenseDate ),
       Shifts[Start date], DESC ),
       "@shift", Shifts[Shift]
    )