Search code examples
powerbidaxpowerquerypowerbi-desktopm

Create summary table from many tables Power BI


I have many tables and from that, I need to create a summary table.

Table 1 -

IDs PSC id PSC ACV id ACV
A3 True 2 False 4
A4 True 3 True 1
A5 False 4 False 4
A6 False 5 True 6

Table 2 -

IDs PSC id PSC ACV id ACV
A5 True 12 False 7
A6 True 3 True 3
A7 False 4 False 4
A9 False 5 True 1

The summary table should be like this (summation of all True and Summation of all False )

Table ACV PSC
Table 1- True 7 5
Table 1 -False 8 9
Table 2- True 4 15
Table 2 -False 11 9

Solution

  • This isn't straightforward - maybe Ron or Horseyride have better ideas.

    Add a custom column to each table with the table name. e.g. enter image description here

    Table 1:

    enter image description here

    Table 2:

    enter image description here

    Append queries as new:

    enter image description here

    Appended table:

    enter image description here

    Group exactly as follows:

    enter image description here

    enter image description here

    Add a custom column:

    enter image description here

    List.Sum( Table.SelectRows(Source, (x)=> x[Custom] = [Custom] and x[ACV id] = [PSC id])[ACV])
    

    Final result:

    enter image description here