Power query - Sumifs on one table (master data) based on criteria from another table.

Sumanth Nair 1 Reputation point
2021-07-06T16:53:58.447+00:00

Need help. How to do sum ifs on master data based on another table.
Master data Hierarchy is Group account (4digit) > Each group account can have several Account number (8 digit) > each account number can have several Segment (5 digit) > and each segmnet can have many Profit center (10 digit). I have used Group function to group the data at profit center level.. The lowest level in the hierarchy. And arrived at the amount per PC (profit center) level.

My criteria table has many conditions on what line items to consider for GRP account total.. (Table 2)

Say for Example for account :

  1. For 1000 (grp account name) take sum of all transaction..irrespective of other criteria.
  2. for 1100 grp account.. take sum of only one account number.. say 11002300
  3. For 1200 group account, take sum of 2 segment..S1562 S1761 (other crtieria dont mater)
  4. For 1300 Group account, take sum of 13005000 account, only one segment S1562, but say 10 different PC PC100000023, PC100000024...PC100000032
  5. For account 1400.. take sum of all transactions but ignore one segment S2013

How can I apply different criteria for each group account to table 1 (master data). And get the total at GRP account level or Account number.

So above table will look something like this.

Grp account---Account number---Segment---Profit center

1000---ALL---ALL-ALL
1100--11002300 only--ALL--ALL
1200--ALL--S1562 and S1761--ALL
1300--13005000 only--S1562 only-- and 10 PCs as provided abvoe
1400--All-- Take all Segment but exclude S2013--All

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Herbert Seidenberg 1,201 Reputation points
    2021-07-08T02:43:40.82+00:00

    Excel 365 Pro Plus with Power Pivot and Power Query.
    Used connected Slicers instead of Table.
    PivotTable is eleganter.
    https://www.mediafire.com/file/020iq080hmmwh7y/07_07_21.xlsx/file
    https://www.mediafire.com/file/nimufp7930pmpc0/07_07_21.pdf/file

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.