Forum Discussion

jk13's avatar
jk13
Frequent Visitor
4 years ago
Solved

How to Lookup a value from a filtered table

Hi all,

 

i have the following data structure tables:

 

requests

request_id name
1

james

2rob
3sam

 

activities

activity_id request_id event      date
11CREATE2022-01-10
21UPDATE2022-01-12
32CREATE2022-01-12

 

I want to add a column "create_date" to the requests-table with the date from the activities where the event is CREATE.

 

There is a one-to-many relationship between requests and activities.

 

I know this should not be that hard, but somehow i struggle to come op with an easy solution. My idea was using lookupvalue based on the filtered activities-table.

 

Thanks for your help!

  • Hi jk13 ,

     

    Create column with below code:-

    create date = 
    CALCULATE(
        MAX(activities[date]),
            activities[event] = "CREATE"
    )

    Output:-

     

     

    Thanks,

    Samarth

1 Reply

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi jk13 ,

     

    Create column with below code:-

    create date = 
    CALCULATE(
        MAX(activities[date]),
            activities[event] = "CREATE"
    )

    Output:-

     

     

    Thanks,

    Samarth