Forum Discussion
JulianaMacedo
Helper II
4 years agoIterating over a list in Power Query
Hi everyone, I'm having difficults getting the results I'm willing... I have a table with a colum that is a result of invoking a function and it gives a list as a result, now I need to iterate ove...
- 4 years ago
Use this
= Table.AddColumn(#"Renamed Columns1", "Test", each let list = [column1] in List.Transform(list, (a)=> if a=0 then "X6" else if a=1 then "X7" else if a=2 then "X14" else if a=3 then "X15" else if a=4 then "X22" else if a=5 then "X23" else if a=6 then "X30" else if a=7 then "X31" else "") )
Vijay_A_Verma
Most Valuable Professional
4 years agoUse this
= Table.AddColumn(#"Renamed Columns1", "Test", each
let list = [column1]
in
List.Transform(list, (a)=>
if a=0 then "X6"
else if a=1 then "X7"
else if a=2 then "X14"
else if a=3 then "X15"
else if a=4 then "X22"
else if a=5 then "X23"
else if a=6 then "X30"
else if a=7 then "X31"
else "")
)