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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mgantt87
New Member

Comparison of two values in a matrix

I am having trouble with the comaprison issue described below.  I have 2 tables (A & B in the example) joined by the column called Group.  The join is many in table A to one in table B.  Both table A and table B have a "type."  It is possible that the type from table A is not equal to the type from table B and when this happens I need to flag the record.  In the example, item 4 from table A shows a type of corn, but it is joined to table B as a fruit and table B has a type of apple, not corn, so this should flag (and conditional format) in the resulting matrix.  I would also like to flag it at the group level so that if the matrix is collapsed, the user can see that the data at the next level down is out of sync.

TableA:  
   
ItemTypeGroup
1AppleFruit
2AppleFruit
3AppleFruit
4CornFruit
5CornVegetable
6CornVegetable

 

Table B: 
  
GroupType
FruitApple
VegetableCorn

 

Table A & B are joined on Group.

Report (matrix):    
     
Group Type (from Table A)Type (from Table B)Flag
Fruit AppleApple1
 1AppleApple0
 2AppleApple0
 3AppleApple0
 4CornApple1
Vegetable CornCorn0
 5CornCorn0
 6CornCorn0
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@mgantt87 

you can merge tables in PQ

11.PNG12.PNG

 

then create a column

flag = if(TableA[Type in Table A]=TableA[Type in Table B],0,1)
 
13.PNG
 
pls see the attachment below




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

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@mgantt87 

you can merge tables in PQ

11.PNG12.PNG

 

then create a column

flag = if(TableA[Type in Table A]=TableA[Type in Table B],0,1)
 
13.PNG
 
pls see the attachment below




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

Proud to be a Super User!




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 MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Users online (655)