Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
royales
New Member

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

RegionDeath ADeath BDeath C
Asia100200300
North America400400500

 

Thank you. Very new to Power BI

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @royales ,

I created some data:

Table1:

vyangliumsft_0-1678762153551.png

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:

vyangliumsft_1-1678762153556.png

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @royales ,

I created some data:

Table1:

vyangliumsft_0-1678762153551.png

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:

vyangliumsft_1-1678762153556.png

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

royales
New Member

when i put them in power BI, no relationship was created between these tables. I downloaded this data for a project and I got like 5 separate tables. Basically, they all look like this, except for the last column where the XX and Death number changes

Region NameCountry NameYearAge GroupDeath by XX
South AmericaBrazil2019[20-29]10
South AmericaBrazil2019[30-39]50
     

 And the list goes on til country Z, year 2021, and age group 80, so it's a long list

FreemanZ
Super User
Super User

hi @royales 

how are the tables related?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.