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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
failson
New Member

How to calculate the difference between two columns from two different table and apply to a matrix

Hi all,

 

Currently I have two different table:

 

1. Table 2024

column: 

Product Jan24 Feb24 ... Dec24

 

2. Table 2025

column:

Product Jan25 Feb25 ... Dec25

 

Then in visual view, I want to create a matrix like this:

 

Product Jan24 Jan25 Difference

 

How to work with it? thanks

2 ACCEPTED SOLUTIONS
Wilson_
Super User
Super User

Hi failson,

 

My first thought is that you would be best served to unpivot your two tables so that you have a month column with 1/31/2024, 2/29/2024, etc. instead of 12 different columns, one for each month. I would also suggest appending the two tables so you have one with both 2024 and 2025 instead of two separate tables.

 

If you need further guidance, can you please share a sample pbix file? (If you don't know how, please check the pinned thread in the forum.) It would make debugging your issue easier. 🙂




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

v-jtian-msft
Community Support
Community Support

Hi,Wilson_ ,thanks for your concern about this issue.Your answer is excellent!

And I would like to share some additional solutions below.

Hello,@failson . I am glad to help you.
Reverse pivot the two tables to create table relationships, you can also filter the data, or use append query to merge the two processed tables into the same table, into a table or matrix to show the final result
1.If you want to compare the difference in data between two tables (provided they have the same table structure with the same number of fields and column names)
You can compare the differences between the two tables by merging the queries. Generate a new table
URL:
Solved: Power Query: compare two tables, return all differ... - Microsoft Fabric Community

2.If one of your tables is missing data and you want to find out what it is, perhaps you can refer to this issue.
URL:
Solved: List missing information in new table - Microsoft Fabric Community


I hope you find the following article helpful.
Comparative Analysis by different values in same dimension in Power BI

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
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

2 REPLIES 2
v-jtian-msft
Community Support
Community Support

Hi,Wilson_ ,thanks for your concern about this issue.Your answer is excellent!

And I would like to share some additional solutions below.

Hello,@failson . I am glad to help you.
Reverse pivot the two tables to create table relationships, you can also filter the data, or use append query to merge the two processed tables into the same table, into a table or matrix to show the final result
1.If you want to compare the difference in data between two tables (provided they have the same table structure with the same number of fields and column names)
You can compare the differences between the two tables by merging the queries. Generate a new table
URL:
Solved: Power Query: compare two tables, return all differ... - Microsoft Fabric Community

2.If one of your tables is missing data and you want to find out what it is, perhaps you can refer to this issue.
URL:
Solved: List missing information in new table - Microsoft Fabric Community


I hope you find the following article helpful.
Comparative Analysis by different values in same dimension in Power BI

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Wilson_
Super User
Super User

Hi failson,

 

My first thought is that you would be best served to unpivot your two tables so that you have a month column with 1/31/2024, 2/29/2024, etc. instead of 12 different columns, one for each month. I would also suggest appending the two tables so you have one with both 2024 and 2025 instead of two separate tables.

 

If you need further guidance, can you please share a sample pbix file? (If you don't know how, please check the pinned thread in the forum.) It would make debugging your issue easier. 🙂




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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