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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Shri_1004
Frequent Visitor

Single Cross Table Visualization for Multiple Data Tables

Hi All,

I am new to Power BI and I need some help. 

 

1. I have to compare the data between two tables having same number of columns and data types. This two tables are for single entity only. For example, Entity A has Table1 and Table2. This comparison will be based on specific column - 'Status', for mismatch data, count needs to be calculated

Sample Data below : for ID 2 and 4, Status is not matching so this count needs to be calculated. 

Table 1  
IDNumber Status
1120New
2122Close
3125Open
4127Close

 

Table 2  
IDNumber Status
1120New 
2122Open
3125Open
4127Open


2. for the same tables, we have to check for the missing data for Number and calculate the count for both Table 1 and Table 2. I have tried with Number = Null filter on both tables 

Table 1 : Count : 2

IDNumber Status
1120New
2122Close
  Open
  Close

Table 2 : Count is 1 

Table 2  
IDNumber Status
1120New 
   
3125Open
4127Open

 
for all these calculation I have to display this in a cross table like below for all entities A,b,c,.... having Table 1 and Table 2

Table NameStatus Mismatch CountTable 1 Missing DataTable 2 Missing Data 
A221
B   
C   

 

Can somebody please help me ? 

@amitchandak ur inputs will be appreciated!
Thanks in advance! 

3 REPLIES 3
v-jianpeng-msft
Community Support
Community Support

Thank you amitchandak 

Hi, @Shri_1004 

Based on your description, I used the data you provided:

vjianpengmsft_0-1724733762202.png

I've created some measures using the following DAX expressions:

Not matching = 
VAR _table1= SUMMARIZE('Table1','Table1'[ID],'Table1'[Status])
VAR _table2= SUMMARIZE('Table2','Table2'[ID],'Table2'[Status])
VAR _cross_table = FILTER(CROSSJOIN(_table1,_table2),'Table1'[ID]='Table2'[ID])
RETURN COUNTAX(FILTER(_cross_table,'Table1'[Status]<>'Table2'[Status]),'Table1'[ID])
Missing Data CountTable 3 = 
VAR _table3 = SUMMARIZE('Table3','Table3'[ID],'Table3'[Number ],Table3[Status])
VAR _table4= SUMMARIZE('Table4','Table4'[ID],'Table4'[Number ],'Table4'[Status])
VAR _avaliable_In_table3 = SELECTCOLUMNS(FILTER(CROSSJOIN(_table3,_table4),'Table3'[ID]='Table4'[ID]),'Table3'[ID])
RETURN COUNTAX(FILTER(_table4,NOT 'Table4'[ID] IN _avaliable_In_table3),'Table4'[ID])
Missing Data CountTable 4 = 
VAR _table3 = SUMMARIZE('Table3','Table3'[ID],'Table3'[Number ],Table3[Status])
VAR _table4= SUMMARIZE('Table4','Table4'[ID],'Table4'[Number ],'Table4'[Status])
VAR _avaliable_In_table3 = SELECTCOLUMNS(FILTER(CROSSJOIN(_table3,_table4),'Table3'[ID]='Table4'[ID]),'Table3'[ID])
RETURN COUNTAX(FILTER(_table3,NOT 'Table3'[ID] IN _avaliable_In_table3),'Table3'[ID])

Here are the results:

vjianpengmsft_1-1724733933583.png

With the above metrics, you'll be able to count the status mismatches or missing data in your table. 

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Shri_1004 , Create a common ID Table

ID = distinct(union(distinct(Table1[ID]),distinct(Table2[ID]) ))

 

Join with both tables

 

Now have measure like

 

n1 = sum(Table1[Number])

 

n2= sum(Table2[Number])

 

S1 = sum(Table1[Status])

 

n2= sum(Table2[Status])

 

Now you can have measures like

 

Count Matched =

Countx(Values(ID[ID]) , if([n1] = [n2], [ID], blank()) )

 

Count not Matched =

Countx(Values(ID[ID]) , if([n1] <>  [n2], [ID], blank()) )

 

 

Status Matched =

Countx(Values(ID[ID]) , if([s1] = [s2], [ID], blank()) )

 

Status not Matched =

Countx(Values(ID[ID]) , if([s1] <>  [s2], [ID], blank()) )

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi @amitchandak Thank you so much for your inputs!!
For Point 1 only we have to do the comparision between Table1 and Table2 based on Status column. 

 

For Point 2, we have to find the count of missing data.

for example, data which is available in Table 1 but not in Table 2 ---- Then this missing data count for Table 2 need to find and display in cross table. Same goes for data which is available in Table 2 but not in Table 1--- this will be missing data for Table 1.

 

This data can be calculated as you have explained but still I have a concern on how to display this data in cross table. Because I have a 100+ entities like A,B,C.... etc having 2 tables. So i have to display it in below format.

Table NameStatus Mismatch Count Table 1 Missing Data CountTable 2 Missing Data Count
A221
B   
C   

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!

December 2024

A Year in Review - December 2024

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