Hi everyone!
I have a specific problem that I was asked to complete using power query only - I have arrived at a solution myself but it feels slow & uses a lot of power query steps, so I was wondering if some brilliant mind could take a look and suggest an easier approach.
(excel file attached)
There are 3 columns:
F ID
Total amount
Year of deal
The years span from 2007 to 2021 - a F ID can have one, several or no values (total amount) in a certain year.
My desired output would be a list that contains the sum of total amount by year of deal for each fund ID, BUT in cases where there is no total amount in a certain year, the row would be "0".
My solution (see power query window in the attached excel):
- group initial table by year & amount
- pivot year column (transposed years on multiple columns)
- replace "null" with "0" on all newly-created years columns
- unpivot the year columns back
It -does- do what I need it to do, however in my opinion it's not an ideal approach - any thoughts as to how I can end up at the final result easier?
Many thanks!!
S
Bookmarks