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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ChrisPBI
Advocate III
Advocate III

Matrix Table Value Changes of Consecutive Years

Hello,

 

what I try to implement is a Matrix Table with value differences for consecutive years.

 

Example:

 

1.PNG

 

 

 

 

 

 

The first row, and the first column mirror each other. In this case, they show the years. The table is filled on the example of:  2008 = 1, 2009 = 2, and 2010 = 3. It is read from left to top or reverse. Reading from left to top shows the chronological order. The diagonal shows dashes because they would only compare the same years with one another. From 2008 to 2009 there is a difference of 1 (2009 = 2 minus 2008 = 1). From 2008 to 2010 there is a difference of 2 (2010 = 3 minus 2008 = 1). From 2009 to 2010 there is a difference of 1 (2010 = 3 minus 2009 = 1). This approach would proceed. Below the diagonal the values change their signs since the view goes in the opposite direction. For instance from 2009 to 2008 the difference is -1 (2008 = 1 minus 2009 = 2).

 

My data model is:

 

1.PNG

 

 

 

 

 

 

 

 

 

 

My table structure is:

 

3.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Is that possible?

 

 

Thanks and Regards,

Chris

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

@ChrisPBI


what I try to implement is a Matrix Table with value differences for consecutive years.

Is that possible?

 


Yes, it is possible to do that.

 

First create a table with the Year information and the corresponding Value, here I create a table called 'TestTable'

TestTable.PNG

Second, create a duplicate table of 'TestTable'(with different column names), called 'TestTable2', with column Year2 and Value2.

TestTable2.PNG

Then use CROSSJOIN to create another table 'TestTable3'.

TestTable3 = CROSSJOIN(TestTable,TestTable2)

Use the following formula to create a custom column [Difference] for 'TestTable3'.

Difference = TestTable3[Value2]-TestTable3[Value]

TestTable3.PNG

Last, use 'TestTable3' to create the Matrix Table.

Result2.PNG

 

Note: the values in matrix can only accept numeric values so that we can’t replace 0 with dash “-”.

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

@ChrisPBI


what I try to implement is a Matrix Table with value differences for consecutive years.

Is that possible?

 


Yes, it is possible to do that.

 

First create a table with the Year information and the corresponding Value, here I create a table called 'TestTable'

TestTable.PNG

Second, create a duplicate table of 'TestTable'(with different column names), called 'TestTable2', with column Year2 and Value2.

TestTable2.PNG

Then use CROSSJOIN to create another table 'TestTable3'.

TestTable3 = CROSSJOIN(TestTable,TestTable2)

Use the following formula to create a custom column [Difference] for 'TestTable3'.

Difference = TestTable3[Value2]-TestTable3[Value]

TestTable3.PNG

Last, use 'TestTable3' to create the Matrix Table.

Result2.PNG

 

Note: the values in matrix can only accept numeric values so that we can’t replace 0 with dash “-”.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors