Forum Discussion
Edit cell in duplicated row
- Anonymous4 years ago
I would just make a duplicate of your original non repeating table, filter the duplicate table to just be the rows that you want repeated, whatever criteria that might be. Once filtered, remove the duplicate column, and add a custom column from the GUI named "duplicate", and make the formula just:
= null
Now, you can use the Append Query button, which is Table.Combine({Table1, Table2}).
Then just sort by Product, then by duplicate-descending.
That's it!
--Nate
You can use the Replace function, it is on the Transform menu.
- mitchell_ian4 years agoNew Member
edhans this will replace the "2" in cell B3 also, I only want to clear the contents of cell B2.
- edhans4 years agoCommunity Champion
Well, you can do it this way:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwoyElV0lEyUorViVZySswDQiDXQCk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]), Custom1 = Table.SelectRows(Source, each [Column1] = "Apple"), #"Replaced Value" = Table.ReplaceValue(Custom1,"2","",Replacer.ReplaceText,{"Column2"}), #"Appended Query" = Table.Combine({#"Replaced Value", Source}) in #"Appended Query"But you aren't being clear on how or why Apple is being duplicated.
How to use M code provided in a blank query:
1) In Power Query, select New Source, then Blank Query
2) On the Home ribbon, select "Advanced Editor" button
3) Remove everything you see, then paste the M code I've given you in that box.
4) Press Done
5) See this article if you need help using this M code in your model.