Forum Discussion
Unsure how to tie this together with Power Query (multiple MAXIFS)
- 6 years ago
Anonymous
= #table({"Craft","Max_Count","PeakMonth","PositionsToFill","Location"},Table.ToList(ActiveStaff, each let a=Table.Sort(Table.SelectRows(CombinedCrewPlans,(x)=>x[Craft]=_{0}),{"Count",1}){0}? in if a=null then {_{0},null,null,null,null} else {_{0},a[Count],a[Date],a[Count]-_{2},a[Location]}))
wdx223_Daniel added that in but still 3 columns of Error
Anonymous you still miss a field name of Max_Count
= #table({"Craft","Max_Count","PeakMonth","PositionsToFill"},Table.ToList(ActiveStaff, each let a=Table.Sort(Table.SelectRows(CombinedCrewPlans,(x)=>x[Craft]=_{0}),{"Count",1}){0}? in if a=null then {_{0},null,null,null} else {_{0},a[Count],a[Date],a[Count]-_{1}}))
- Anonymous6 years agoNot applicable
wdx223_Daniel wow thanks, that was a pretty big miss.
I still have 'Error' in the PositionsToFill column. Also, if I wanted to add Location to this table from CombinedCrewPlans where do I add that in. Struggling to understand the column populations with this one, but am trying to disect the command. Appreciate your assistance with this one, it is a great learning exercise for me seeing this unfold.S.
- wdx223_Daniel6 years ago
Community Champion
Anonymous
= #table({"Craft","Max_Count","PeakMonth","PositionsToFill","Location"},Table.ToList(ActiveStaff, each let a=Table.Sort(Table.SelectRows(CombinedCrewPlans,(x)=>x[Craft]=_{0}),{"Count",1}){0}? in if a=null then {_{0},null,null,null,null} else {_{0},a[Count],a[Date],a[Count]-_{2},a[Location]}))- Anonymous6 years agoNot applicable
wdx223_Daniel amazing thanks. I have made a mess of location somewhere as it isn't splitting out the sites for Sydney and Vancouver but I will figure that one out.
Greatly appreciate the time spent with this one.
Cheers.