Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Replace value on filtered column

Hello all

 

I am trying to do the following and I am stuck. 

 

I want to filter in a column for a specific value, let that be for example Column A - "Cost Center ABCD". Once I filter, i want to replace the value of another column for example Column B - from "XYZ" to "KLM". So far all is good. 

When the value is replaced, as by magic the filter icon over column A is disappeared and my entire table is gone, the only that I am able to see is the value that i filtered at the beginning. Column A - "Cost Center ABCD".

Am i doing something wrong?

 

Thanks

F

3 Replies

  • lkalawski's avatar
    lkalawski
    Icon for Resident Rockstar rankResident Rockstar

    Hi fanisgeorg,

    You probably do it in Power Query. As you can see, you add the next steps in editing. The first step is data filtering and the second step is data replacing. Each step contains its own data set, so only filtered data goes to the last step.

     

    To achieve what you want, you must do the following change:

     

    Instead of using Filtered Rows and Replaced Value1 lines, please use only the last line: Replaced Value . There is a condition in which the value is to be changed.

     

    #"Replaced Value" = Table.ReplaceValue(Source,each [Column B],each if [Column A] = "Cost Center ABCD" then "KLM" else [Column B],Replacer.ReplaceValue,{"Column B"})

     

     

    If I helped, please accept the solution and give kudos! ğŸ˜€

  • dax's avatar
    dax
    Icon for Community Support rankCommunity Support

    Hi Anonymous , 

    I am not clear about your data structure, you could try to refer to my sample for details. If this is not what you want, please correct me and inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

    Please do mask sensitive data before uploading.

    Thanks for your understanding and support.
    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hello, someone knows how to replace filtered values and then return to the filter of the provinces and also change the blank data for another population, I ask this because, when changing this blank data the table is left with only the data of Ceuta.