Forum Discussion

royales's avatar
royales
New Member
3 years ago
Solved

Grouping & combining values from several tables

I have 3 tables (for 3 different causes of death). Each table has Country list,  Region, Number of deaths. How do I create a table /measure that will summarize into something like this Region D...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  royales ,

    I created some data:

    Table1:

    Here are the steps you can follow:

    1. Create calculated table.

    Table =
    var _table1=
    SUMMARIZE(
        'Table1','Table1'[Region Name],"DeathA",SUMX(ALL('Table1'),[Death A]),"DeathB",SUMX(ALL('Table1'),[Death B]),"DeathC",SUMX(ALL('Table1'),[Death C]))
    var _table2=
    SUMMARIZE(
        'Table2','Table2'[Region Name],"DeathA",SUMX(ALL('Table2'),[Death A]),"DeathB",SUMX(ALL('Table2'),[Death B]),"DeathC",SUMX(ALL('Table2'),[Death C]))
    var _table3=
    SUMMARIZE(
        'Table3','Table3'[Region Name],"DeathA",SUMX(ALL('Table3'),[Death A]),"DeathB",SUMX(ALL('Table3'),[Death B]),"DeathC",SUMX(ALL('Table3'),[Death C]))
    return
    UNION(
    _table1,_table2,_table3)

    2. Result:

    If I have misunderstood your meaning, please provide your desired output and your pbix file without privacy information.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly