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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ldamato
Frequent Visitor

Combine 2 tables into one matrix

Hi everyone. 

I have 2 tables and both have the same columns. They are the same structure with different values: 

ldamato_0-1655745460728.png

My goal here is transform these 2 tables into one matrix like this below:

ldamato_1-1655745510640.png

I tried to search, but I think I don't know what to search for to find this result I want. 

I did a full outer merge so far to combine they both into one query, but from there I'm stuck.

 

Will appreciate your help.

Thanks, 

Leo

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @ldamato 

you can do the following in power query

1. add a new column in table1:

Table = "Table1"

2. add a new column in table2:

Table = "Table2"

3. Append the two tables in one master table

4. unpivot the 4 columns that have numeric values. That would create an Attribute column containing the names of the 4 columns and a Value column containing all numeric values. 

5. In your matrix drag the column [Attribute] from the master table into the rows and drag the column [Table] into the columns. 
6. create two measures: 

MAX ( 'Master Table'[Value] )

and

MIN ( 'Master Table'[Value] )

7. place both measures in values of the matrix. 

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @ldamato 

you can do the following in power query

1. add a new column in table1:

Table = "Table1"

2. add a new column in table2:

Table = "Table2"

3. Append the two tables in one master table

4. unpivot the 4 columns that have numeric values. That would create an Attribute column containing the names of the 4 columns and a Value column containing all numeric values. 

5. In your matrix drag the column [Attribute] from the master table into the rows and drag the column [Table] into the columns. 
6. create two measures: 

MAX ( 'Master Table'[Value] )

and

MIN ( 'Master Table'[Value] )

7. place both measures in values of the matrix. 

Wow. It worked like a charm.

Thank you so much @tamerj1 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors