Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
For each row in this table i want to add a new row and just change "belop" to "- whatever "belop" and Kontoart to "1".
I want to do this as a step in advanced editor. Can anyone help me write the code?
Solved! Go to Solution.
Hi @Anonymous ,
You can try this query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnR0VNJRMgViQwOlWJ1oJScnJyDHEoiNIALOzs5AjjEIQwRcXFyAHDMgNoEIuLq6AjnmIHOAArEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Kontoart = _t, Belop = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Kontoart", Int64.Type}, {"Belop", Int64.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Name"}),
#"Replaced Value" = Table.ReplaceValue(#"Removed Columns",each [Belop],each [Belop]*-1,Replacer.ReplaceValue,{"Belop"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",each [Kontoart],1,Replacer.ReplaceValue,{"Kontoart"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value1",{{"Belop", Int64.Type}}),
#"Append table" = Table.Combine({#"Changed Type", #"Changed Type1"})
in
#"Append table"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Table Repeat" = Table.Repeat(Table.TransformColumns(#"Added Index", {{"Beløp", each _ * -1, type number}}),2)
in
#"Table Repeat"
I tried this, but it applies to the whole table not just the copied one.
Hi @Anonymous ,
You can try this query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnR0VNJRMgViQwOlWJ1oJScnJyDHEoiNIALOzs5AjjEIQwRcXFyAHDMgNoEIuLq6AjnmIHOAArEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Kontoart = _t, Belop = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Kontoart", Int64.Type}, {"Belop", Int64.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Name"}),
#"Replaced Value" = Table.ReplaceValue(#"Removed Columns",each [Belop],each [Belop]*-1,Replacer.ReplaceValue,{"Belop"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",each [Kontoart],1,Replacer.ReplaceValue,{"Kontoart"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value1",{{"Belop", Int64.Type}}),
#"Append table" = Table.Combine({#"Changed Type", #"Changed Type1"})
in
#"Append table"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can duplicate the table, add columns to replace the existing ones (not sure exactly what you want for belop , multiply by -1 maybe). Remove the old columns.
Then Append the new table and the original table together using the interface( from the ribbon->Home->Combine)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |