Forum Discussion
turp111
3 years agoFrequent Visitor
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...
- 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.
v-jingzhang
3 years agoCommunity Support
Hi turp111
You can add a custom column with below code. Modify "Previous Step Name" accordingly.
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 List.Max(Table.SelectRows(#"Previous Step Name", each [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.