The following table needs to be manipulated:
Col1 | Col2 | Col3 | Col4 | Col5 | Col6| Col7
Line1: null | null | Plan | null | null | null| null
Line2: null | null | 1 | 2 | 3 | 4 | null
The task is to take the value from Col3 Line1 and place it in front of each cell beginning from Col3 Line2 to Col6 Line2.
The result would look like
Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | Col7
Line1: null | null | Plan | null | null | null | null
Line2: null | null | Plan1| Plan2| Plan3| Plan4| null
Do you have any idea?
The following table needs to be manipulated:
Col1 | Col2 | Col3 | Col4 | Col5 | Col6| Col7
Line1: null | null | Plan | null | null | null| null
Line2: null | null | 1 | 2 | 3 | 4 | null
The task is to take the value from Col3 Line1 and place it in front of each cell beginning from Col3 Line2 to Col6 Line2.
The result would look like
Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | Col7
Line1: null | null | Plan | null | null | null | null
Line2: null | null | Plan1| Plan2| Plan3| Plan4| null
Do you have any idea?
Share Improve this question asked Feb 5 at 15:19 Rasputin221Rasputin221 1771 silver badge12 bronze badges 4 |1 Answer
Reset to default 0Depending on your actual problem, here is one method that might work for you:
Insert the code below after whatever step shows the table you showed in your question
Change #"Previous Step"
to reflect the name of the actual Previous Step
in your query:
...
#"Prefix Col3 Line1" = Table.ReplaceValue(
Table.Skip(#"Previous Step",1), //Return table except for first row
#"Previous Step"{0}[Col3], // Value in Column 3 Line 1
null,
(x,y,z) as text=>y & x, //Combine Column 3 Line 1 with values in each row of the selected columns
List.Range(Table.ColumnNames(#"Previous Step"),2,4)), //Array of the required Column Names
//Combine above with the original Line 1
#"Add Back Line1" = Table.Combine({Table.FromRecords({#"Previous Step"{0}}), #"Prefix Col3 Line1"})
in
#"Add Back Line1"
#"Previous Step"
Result
Table.ReplaceValue
function if your real data is similar to what you show. Please edit your question to show what you have tried, and where you have run into problems. – Ron Rosenfeld Commented Feb 5 at 18:51