Forum Discussion

rjs2's avatar
rjs2
Resolver I
6 years ago
Solved

Max sequence number filtered

The data I am working has a parent sequence number and a child sequence number.  I want to be able to return the max sequence number filtered on a date.   I have tried many diffent ways to accompli...
  • rjs2's avatar
    rjs2
    6 years ago

    Took some time, but I solved it.  It was easier to stop into it with two columns

     

    First new column:

    Max on Day = CALCULATE(MAX('Vetting Query'[CHILD_SEQ]),ALL('TABLE'),'TABLE'[PARENT_SEQ]=EARLIER('TABLE'[PARENT_SEQ]) && 'TABLE'[CHILD_SEQ_DATE]=EARLIER('TABLE'[CHILD_SEQ_DATE]))

     

    This gave me the max sequence number for the child sequence per day on every row related to that parrent seq.

     

    Second new column:

    Number Processed = if('TABLE[Max on Day]='TABLE[CHILD_SEQ],'Vetting Query'[CHILD_SEQ],"")

     

    The Number Processed will only have the Max CHILD_SEQ on the row of the Max sequence number and a blank if its not the max sequence number.