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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
powerbeei
Regular Visitor

Matrix aggregate match

Hi All,

 

Can anyone please help me with the below ? My Data looks similar to the below two tables.

I want to create a matrix based on these tables.

 

powerbeei_2-1674536983108.png                 powerbeei_3-1674537005521.png

 

 

Result :

powerbeei_5-1674538920693.png

 

 Basically, I want to put the old amount and the new amount  against the old category in the matrix.

 

Any help is appreciated.

 

Thanks,

 

 

1 ACCEPTED SOLUTION

hi @powerbeei 

try to

1) relate two tables via Cat and Cat_new column

FreemanZ_1-1674566801455.png

 

2) write three measures like:

 

_Amt1 = SUM(Table1[Amt1])

_Amt2 = SUM(Table2[Amt2])

Variance = [_Amt1] - [_Amt2]

 

 

3) plot a matrix in Power BI Desktop or pivot table in Excel like:

FreemanZ_2-1674566963446.png

 

The most critical part is to relate two tables via Cat and Cat_new column, instead by Key columns suggested by default. 

 

View solution in original post

4 REPLIES 4
powerbeei
Regular Visitor

Hi @VahidDM Sorry, Please see the data below

Key Column1 Cat Amt1
1000|21/02/2022 A E1 252
1000|21/02/2023 A E2 255
1001|21/02/2024 A E3 258
1002|21/02/2025 A E4 261
1000|21/02/2026 A E5 264
1000|21/02/2027 A E6 267
1000|21/02/2030 B F0 276
1003|21/02/2031 B F1 279
1000|21/02/2029 C H0 273
1000|21/02/2028 C H1 270

 

Table 2

Key Cat_new Amt2
1001|21/02/2024 E1 125
1000|21/02/2023 E2 101
1000|21/02/2022 E3 100
1002|21/02/2025 E3 125
1000|21/02/2026 E5 249
1000|21/02/2030 F0 125
1000|21/02/2027 F1 300
1003|21/02/2031 F1 158
1000|21/02/2028 H1 355
1000|21/02/2029 H1 387

 

hi @powerbeei 

try to

1) relate two tables via Cat and Cat_new column

FreemanZ_1-1674566801455.png

 

2) write three measures like:

 

_Amt1 = SUM(Table1[Amt1])

_Amt2 = SUM(Table2[Amt2])

Variance = [_Amt1] - [_Amt2]

 

 

3) plot a matrix in Power BI Desktop or pivot table in Excel like:

FreemanZ_2-1674566963446.png

 

The most critical part is to relate two tables via Cat and Cat_new column, instead by Key columns suggested by default. 

 

Thanks @FreemanZ . Think will have to use Categories to relate the table as you suggested. Was hoping to use dates if I need to plot YTD etc. but will come with work around if needed.

Thanks for your help.

VahidDM
Super User
Super User

Would you please send your sample data table in a text format to be able to copy and paste them into PBI?

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.