Search code examples
powerbidaxpowerbi-desktopdata-cleaning

Summarize multiple tables into one table


I have many tables ( derived from a single table ) like.

Table 1 -

ID PSC BWC
A1 2 1
B1 3 8
C1 4 7
D1 5 6
Total 14 22

Table 2 -

ID PSC BWC
q1 5 11
d1 3 8
f1 4 7
qw1 5 6
Total 17 32

Table 3-

ID PSC BWC
aq1 5 11
as1 3 8
sf1 14 7
qsw1 5 16
Total 27 42

My expectation is -

Summary table -

Name PSC BWC
Expiry 14 22
Renew 17 32
DOD 27 42

Solution

  • enter image description here

    Summary Table = 
    UNION(
        SUMMARIZECOLUMNS(
            Table1,"Name", "Expiry", "PSC", SUM(Table1[PSC]), "BWC", SUM(Table1[BWC])      
        ),
        SUMMARIZECOLUMNS(
            Table2,"Name", "Renew", "PSC", SUM(Table2[PSC]), "BWC", SUM(Table2[BWC])      
        ),
        SUMMARIZECOLUMNS(
            Table3,"Name", "DOD", "PSC", SUM(Table3[PSC]), "BWC", SUM(Table3[BWC])      
        )
    )