Forum Discussion
Transform List - Taking from different fields and taking from List Previous Record (after Transform)
Hello PQ Gurus,
Given A List Below
| List | Desired Result in List Form |
1 | 10 <- Assume this is the [WeekNum] value of the same record |
| 0 | 10 |
| 0 | 10 |
| 1 | 12 <- Assume this is the [WeekNum] value of the same record |
| 0 | 12 |
| 0 | 12 |
| 0 | 12 |
| 1 | 28 <- Assume this is the [WeekNum] value of the same record |
| 0 | 28 |
My question is, how can I tranform this List into when it's a value 1, get it from a different field (i.e. [WeekNum]) and if it's 0, get from the previous List Record?
Note that in actuality, I have only 1 column for my List. The "table" above is just to show my desired result from the original list (left side of table 1st column) to my desired end result as a list (right side of table 2nd column)
3 Replies
- wdx223_DanielCommunity Champion
NewStep=Table.FillDwon(Table.ReplaceValue(YourTable,each [WeekNum],"",(x,y,z)=>if x=1 then y else null,{"ListCol"}),{"ListCol"})
- JustDavidHelper IV
Gives an error that says 'We cannot convert the value 1 to type Text.
= Table.FillDown( Table.ReplaceValue(#"Added Index",each [#"Week Num"],"",(x,y,z)=>if x=1 then y else null,_MyListStepBelowAddedIndex),_MyListStepBelowAddedIndex)- wdx223_DanielCommunity Champion
= Table.FillDown( Table.ReplaceValue(#"Added Index",each [#"Week Num"],"",(x,y,z)=>if x="1" then y else null,_MyListStepBelowAddedIndex),_MyListStepBelowAddedIndex)