Forum Discussion

turp111's avatar
turp111
Frequent Visitor
3 years ago
Solved

Adding Custom Column and pulling values from other rows

I need to add a new column with conditions but also to pull a value from another row if a certain condition is met.  Below is my table and columns, here are my conditions: If FEE_TYPE = 2 and SF_FI...
  • v-jingzhang's avatar
    v-jingzhang
    3 years ago

    Hi turp111 

     

    Please use this new code:

    if [FEE_TYPE] = 2 and [SF_FIN_SERV_ID] <> "" then [SF_NAME1] else if [FEE_TYPE] = 2 and [SF_FIN_SERV_ID] = "" then "NATIONWIDE" else if [FEE_TYPE] = 1 then let vPlan = [PLAN] in List.Max(Table.SelectRows(#"previous step", each [PLAN] = vPlan and [SF_FIN_SERV_ID] = "TP")[SF_NAME1]) else ""

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.