Forum Discussion
Jonas_
4 years agoNew Member
Combining tables analytical accounting
Hello, I have 3 different tables: The first is from the classical accounting. Booking reference Amount … 251 € 100.00 252 € 150.00 253 € 400.00 ...
- 4 years ago
Merge the 2nd and 3rd table into the first one, expanding the cost and percentage columns from each, and then define a new custom column that multiplies the percentages with the initial amount.
let Source = Centers, #"Grouped Rows" = Table.Group(Source, {"Booking reference"}, {{"Amount", each List.Sum([Amount]), type nullable number}}), #"Merged Queries" = Table.NestedJoin(#"Grouped Rows", {"Booking reference"}, Centers, {"Booking reference"}, "Centers", JoinKind.LeftOuter), #"Expanded Centers" = Table.ExpandTableColumn(#"Merged Queries", "Centers", {"Cost center", "Percentage"}, {"Cost center", "Center%"}), #"Merged Queries1" = Table.NestedJoin(#"Expanded Centers", {"Booking reference"}, Places, {"Booking reference"}, "Places", JoinKind.LeftOuter), #"Expanded Places" = Table.ExpandTableColumn(#"Merged Queries1", "Places", {"Cost place", "Percentage"}, {"Cost place", "Place%"}), #"Added Custom" = Table.AddColumn(#"Expanded Places", "Custom", each [#"Center%"] * [#"Place%"] * [Amount], type number) in #"Added Custom"See the attached file.
Daniel_Fdrvc
Helper I
4 years agoCan you explain - last two columns in final table - how did they come here? Are these any calculations? Or maybe it doesn't matter?
% | Percentage | Ammount |
AlexisOlson
Super User
4 years agoThe last column I gave is a calculated, yes. It's the initial Amount multiplied by the two percentage columns.
I neglected the final percentage column you initially asked for but it's the same logic, just the product of the other two percentage columns.