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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ChrisPBI
Advocate II
Advocate II

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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