• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How can I make the actions on power query to be effected only on the desired rows.

harivardhan

New Member
Screenshot 2024-01-29 121933.jpg
The above table is sample to explain my requirement.
In the above table. I want to move the 2nd and 3rd columns to the right only for the rows that are against the S.no = 2.
Similarly, I want move 3rd column to the right, only for the rows That are against S.no=3 .
The action of move the column to the right is only an example.. I want to do diff action to the desired columns only, based on the S.no.
Thankyou in advance.
 
Show us a mocked up solution based upon the sample provided. BTW, pictures are of little value as the data cannot be manipulated. Attaching a sample file is the preferred method so that we don't have to re type your data.
 
Don't know how useful this will be but this seems to work:
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Result = Table.FromRecords(Table.AddColumn(Source, "Custom", each if [S.no]=2 then Record.FromList(List.RemoveLastN(List.InsertRange(Record.ToList(_),1,{null}),1),Table.ColumnNames(Source)) else if [S.no]=3 then Record.FromList(List.RemoveLastN(List.InsertRange(Record.ToList(_),2,{null}),1),Table.ColumnNames(Source)) else _)[Custom])
in
    Result
 
Show us a mocked up solution based upon the sample provided. BTW, pictures are of little value as the data cannot be manipulated. Attaching a sample file is the preferred method so that we don't have to re type your data.
 

Attachments

  • sample rough table.xlsx
    9.7 KB · Views: 4
Back
Top