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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
bbajuscak
Helper I
Helper I

Display Differences Between 2 Matrices

I have 2 seperate matrices, each built from different data sources, using different tables and table structures. Tables making up each matrix are not related to one another.

Each matrix is a heirarchy showing the work breakdown structure ( stories roll up into epics, epics roll up into projects, projects roll up into initiatives) The heirarchy in each is important.

How can I highlight the differences between the matrices? Matrix 1 being the source of truth.

Ideally I'd like to highlight in Red any items that is out of place from Matrix 1.

I need to be able to visualize what items in matrix 2 are different from matrix 1. Different being both what is missing as well as what items are in a different heirarchy from matrix 1 vs matrix 2.

Below is a screenshot of the 2 matrices currently built out and needing to compare. ie. visualize when a story is assigned to a different epic, or different project and see that heirarchy.

 

 

bbajuscak_0-1741723299177.png

 

My tables and table structure is different for each matrix as seen below. Circled Red are tables used to create matrix 1. Circled Green are tables used to create matrix 2.

bbajuscak_1-1741723699687.png

I'd like to create a third, or a new matrix, which displays the heirarchy for only those that are different between the 2 initial matrices.

 

Any insight is greatly appreciated!

 

1 ACCEPTED SOLUTION

You will want to clean this up as it will have a massive impact on performance.

 

Here is the general approach for the comparison

 

 

DEFINE
	VAR a = SELECTCOLUMNS(SUMMARIZECOLUMNS(
							'KI - Epics'[Initiative Name],
							'KI - Epics'[Project Name],
							'KI - Story'[Key + Status],
							'KI - Epics'[Key + Status]),
			"Column1", 'KI - Epics'[Initiative Name],
			"Column2", 'KI - Epics'[Project Name],
			"Column3", 'KI - Story'[Key + Status],
			"Column4", 'KI - Epics'[Key + Status])
	VAR b = SELECTCOLUMNS(SUMMARIZECOLUMNS(
							'Initiatives - Issues'[SUMMARY],
							'Project - Issues'[SUMMARY],
							'Epics - Issues'[Key + Status],
							'Stories - Issues'[Key + Status]),
			"Column1", 'Initiatives - Issues'[SUMMARY],
			"Column2", 'Project - Issues'[SUMMARY],
			"Column3", 'Epics - Issues'[Key + Status],
			"Column4", 'Stories - Issues'[Key + Status])
EVALUATE
	EXCEPT(a,b)

 

View solution in original post

14 REPLIES 14
bbajuscak
Helper I
Helper I

@AllisonKennedy 
@lbendlin 


Here is a link to the pbix file I am working with:

WorkBreakdownStructureV4.pbix

 

I would like to end up with 2 matrices, each only showing the wbs which is not present in the other matrix, not the entire wbs

 

Link requires access. please check.

@lbendlin 

corrected access, please try this link

WorkBreakdownStructureV4.pbix

still the same.

Hmmm, 1st time trying to share out a pbix...can you try this link and let me know if it works correctly?

@lbendlin 

https://1drv.ms/u/c/af6876c99b2bc15d/EdJjZSP_W5RIi8hw2oIRwmgBQPN1-QSL9bgD0SKPVrV1DQ

 

 

This time it worked. Can you please explain that data model to me?  Why all the bidirectionals?

 

lbendlin_0-1741878633329.png

 

I'd like to give you a logical reason for the bidirectional relationships, but I didn't realize they were set up that way.

Data is coming from 2 seperate systems, I am attempting to compare the WBS out of each to verify alignment between the two.

You will want to clean this up as it will have a massive impact on performance.

 

Here is the general approach for the comparison

 

 

DEFINE
	VAR a = SELECTCOLUMNS(SUMMARIZECOLUMNS(
							'KI - Epics'[Initiative Name],
							'KI - Epics'[Project Name],
							'KI - Story'[Key + Status],
							'KI - Epics'[Key + Status]),
			"Column1", 'KI - Epics'[Initiative Name],
			"Column2", 'KI - Epics'[Project Name],
			"Column3", 'KI - Story'[Key + Status],
			"Column4", 'KI - Epics'[Key + Status])
	VAR b = SELECTCOLUMNS(SUMMARIZECOLUMNS(
							'Initiatives - Issues'[SUMMARY],
							'Project - Issues'[SUMMARY],
							'Epics - Issues'[Key + Status],
							'Stories - Issues'[Key + Status]),
			"Column1", 'Initiatives - Issues'[SUMMARY],
			"Column2", 'Project - Issues'[SUMMARY],
			"Column3", 'Epics - Issues'[Key + Status],
			"Column4", 'Stories - Issues'[Key + Status])
EVALUATE
	EXCEPT(a,b)

 

Is this using DAX or creating a measure?

Yes and no.  This is DAX but it results in a table. A measure will be unable to show the differences, it will only be able to indicate that there is a difference (rowcount more than 0)

I have eliminated the bidirectional relationships with my tables. When I try to run the query I receive an error, Resource Governing. Any ideas on how to get around this?

bbajuscak_0-1741885068149.png

 

Get a better computer, or use fewer columns for the comparison.  You could also load the tables into a real database and do anti-joins.

AllisonKennedy
Super User
Super User

@bbajuscak  The only way to highlight differences is to have the data related in some way. One option is to use Power Query and do a merge - you could do a 'left outer' merge to find only things that are in the first table and not in the second table. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

lbendlin
Super User
Super User

Use EXCEPT().

 

If you like help please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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