Forum Discussion
add conditional column
- Anonymous3 years ago
Hi Anonymous ,
1. add a custom column like:2. merge queries:
3. expand and rename [Saldo] column:
#"Added Custom" = Table.AddColumn(#"Umbenannte Spalten", "Custom", each Date.AddMonths([Date],-1)), #"Merged Queries" = Table.NestedJoin(#"Added Custom", {"Nummer", "Custom"}, #"Added Custom", {"Nummer", "Date"}, "Sorted Rows", JoinKind.LeftOuter), #"Expanded Sorted Rows" = Table.ExpandTableColumn(#"Merged Queries", "Sorted Rows", {"Saldo"}, {"Saldo.1"}), #"Removed Columns" = Table.RemoveColumns(#"Expanded Sorted Rows",{"Custom"}), #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Saldo.1", "saldo previous month"}}) in #"Renamed Columns"Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Anonymous can you share your sample pbix file
Yes, I can't upload files yet. It's only possible to share links so I saved it on a onedrive link:
- Anonymous3 years agoNot applicable
Hi Anonymous ,
1. add a custom column like:2. merge queries:
3. expand and rename [Saldo] column:
#"Added Custom" = Table.AddColumn(#"Umbenannte Spalten", "Custom", each Date.AddMonths([Date],-1)), #"Merged Queries" = Table.NestedJoin(#"Added Custom", {"Nummer", "Custom"}, #"Added Custom", {"Nummer", "Date"}, "Sorted Rows", JoinKind.LeftOuter), #"Expanded Sorted Rows" = Table.ExpandTableColumn(#"Merged Queries", "Sorted Rows", {"Saldo"}, {"Saldo.1"}), #"Removed Columns" = Table.RemoveColumns(#"Expanded Sorted Rows",{"Custom"}), #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Saldo.1", "saldo previous month"}}) in #"Renamed Columns"Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
- marcobi3 years agoHelper I
Thank you very much, yeah it worked 🙂 Actually way more easy than i thought before!
Unfortunately I can't log in in the account i posted this before, thats why I can't directly accept it as a solution 😕