Forum Discussion

sivasrao's avatar
sivasrao
Helper III
3 years ago

Last Data Value and Count

Event ActivityEvent TimeTarget 1Target 2
1C100010000
1C100110010
1C100210023
1R100310020
1R100410020
1R100510020
1C100610060
1C100710072
1R100810070
1R100910070

 

Target 1: Whenever R comes, the value of the Time column is the previous value of C (like 1002)

Target 2: Count of R's value saved as the value of the previous C column.

 

Please help with this.

7 Replies

      • Anonymous's avatar
        Anonymous
        Not applicable

        Sorry sivasrao , I wanted the notifications on this thread. Wanted to learn how to solve the same question.

  • shrabedi's avatar
    shrabedi
    Frequent Visitor

    For Target 1

    Target 1 = 
    IF('Table'[Event] = "R",
       CALCULATE(
           MAX('Table'[Time]),
           FILTER('Table', 'Table'[Event] = "C" && 'Table'[Time] < EARLIER('Table'[Time]))
       ),
       'Table'[Time]
    )

    Regards
    Accept as a solution if it works.

    • sivasrao's avatar
      sivasrao
      Helper III

      Thank you for your quick reply.

       Target 2 is the more preferable requirement.

      Pls try on this too.