Share via

Power Query Column Replace Help

Osceola Delgado 1 Reputation point
2021-07-05T16:37:24.143+00:00

I want to replace 2 column in same step of power query . Let suppose I have 1-3 in one column and 2-3 is second column . with single step I want to multiply each value with 2 and replace it with new value

Thanks

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Lz365 38,201 Reputation points Volunteer Moderator
    2021-07-05T17:28:39.557+00:00

    Hi @Osceola Delgado

    Assuming I understood, one way:

    let  
    // Table for demo.  
        Source = Table.FromColumns(  
            { {1..5}, {6..10}, {"a".."e"} },  
            type table [NumOne=number, NumTwo=number, Aplha=text]  
        ),  
    //  
        ReplacedNum = List.Accumulate({"NumOne","NumTwo"}, Source,  
            (state,current)=>  
                Table.TransformColumns(state,  
                    {current, each _ *2, type number}  
                )  
        )  
    in  
        ReplacedNum  
    

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.