Forum Discussion
Magnus-CPH-DK
3 years agoHelper II
Custom Column - For each ID where [Column_1] = X, return Y where [Column_2] = A or B
Hi there, In the table below I want to do something like this: "For each [Case_ID] where [Metric] = "Comment", return [Score] where [Metric] = "Satisfaction (INC)" or "Satisfaction (REQ)" ...
wdx223_Daniel
3 years agoCommunity Champion
if the values in the column of Metric is unique for each ID, then this code may work.
=let a=Table.Buffer(Table.Group(PreviousStepName,"Case_ID",{"n",each _})) in Table.AddColumn(PreviousStepName,"Desired_Outcome",each let b=a{[Case_ID=[Case_ID]]}? in if [Metric]<>"Comment" or b=null then null else b{[Metric="Satisfaction (INC)"]}?[Score]? ??b{[Metric="Satisfaction (REQ)"]}?[Score]?)
- Magnus-CPH-DK3 years agoHelper II
Hi wdx223_Daniel
Thank you for your reply.The question marks you have posted in your code is not accepted in the editor.
Should they be another symbol instead?
Kind regards Magnus