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
RanHo
Helper V
Helper V

Get number count of column that are not in other column/table

Good day!

  Need help here , how to get count of EVALUATION ID that are not in TABLE TEST?
Here's my sample data with 3 tables:

TABLE EVALUATION TABLE EMPLOYEE  TABLE TEST  
IDEMPLOYEE_IDIDEMPLOYEE_NO IDEMPLOYEE_NO 
100111TC-001 2001TC-002 
100232TC-002 2002TC-004 
100363TC-003 2003TC-005 
100474TC-004 2004TC-008 
1005105TC-005 2005TC-009 
1006 6TC-006 2006  
1007 7TC-007 2007  
1008 8TC-008 2008  
1009 9TC-009 2009  
1010 10TC-010 2010  


thanks in advance!

~RAN

3 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @RanHo - i have created a mapping as below:

Relationship 1: TABLE EVALUATION[EMPLOYEE_ID] links to TABLE EMPLOYEE[ID].

This relationship helps connect evaluations to employees.
Relationship 2: TABLE EMPLOYEE[EMPLOYEE_NO] links to TABLE TEST[EMPLOYEE_NO].

This relationship helps identify which employees have corresponding entries in TABLE TEST.

 

 

rajendraongole1_0-1730871989399.png

 

 

rajendraongole1_1-1730872296950.png

 

 

CountMissingEvaluationIDs =
CALCULATE(
    COUNTROWS('TABLE EVALUATION'),
    FILTER(
        'TABLE EVALUATION',
        VAR EmpNo = LOOKUPVALUE(
            'TABLE EMPLOYEE'[EMPLOYEE_NO],
            'TABLE EMPLOYEE'[ID], 'TABLE EVALUATION'[EMPLOYEE_ID]
        )
        RETURN
            ISBLANK(
                LOOKUPVALUE(
                    'TABLE TEST'[ID],
                    'TABLE TEST'[EMPLOYEE_NO], EmpNo
                )
            )
    )
)
 
Hope this helps.




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

Proud to be a Super User!





View solution in original post

shafiz_p
Super User
Super User

Hi @RanHo  Don't know your relationship among the tables. I have considered this:

shafiz_p_0-1730873055892.png

 

I think you need to count employee which are in the evaluation but not in the Test. If this is the case, try this:

MissingEvaluationCount = 
COUNTROWS(
    FILTER(
        EMPLOYEE,
        NOT EMPLOYEE[EMPLOYEE_NO] IN VALUES(TEST[EMPLOYEE_NO])
    )
)


I have this output:

shafiz_p_1-1730873197800.png

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

 

View solution in original post

Hi @RanHo 

 

Thanks for the reply from FreemanZ , rajendraongole1 and shafiz_p .

 

Do the methods solve your problem? If so, could you please mark helpful answers as solutions? This will help more users who are facing the same or similar difficulties. Thank you!

 

If the problem is not solved , please try the following measure.

Count = 
COUNTROWS (
    EXCEPT (
        SELECTCOLUMNS ('TABLE EVALUATION', "EVALEVALUATION", 'TABLE EVALUATION'[ID]),
        SELECTCOLUMNS ('TABLE TEST', "EVALEVALUATION1", 'TABLE TEST'[ID])
    )
)

 

Output:

vxuxinyimsft_0-1732006579298.png

 

Best Regards,
Yulia Xu

 

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

View solution in original post

7 REPLIES 7
shafiz_p
Super User
Super User

Hi @RanHo  Don't know your relationship among the tables. I have considered this:

shafiz_p_0-1730873055892.png

 

I think you need to count employee which are in the evaluation but not in the Test. If this is the case, try this:

MissingEvaluationCount = 
COUNTROWS(
    FILTER(
        EMPLOYEE,
        NOT EMPLOYEE[EMPLOYEE_NO] IN VALUES(TEST[EMPLOYEE_NO])
    )
)


I have this output:

shafiz_p_1-1730873197800.png

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

 

RanHo
Helper V
Helper V

TABLE EVAL is connected to TABLE EMPLOYEE then TABLE EMPLOYEE to TABLE TEST.

hi @RanHo ,

 

who is on the one side in the relationships?

rajendraongole1
Super User
Super User

Hi @RanHo - i have created a mapping as below:

Relationship 1: TABLE EVALUATION[EMPLOYEE_ID] links to TABLE EMPLOYEE[ID].

This relationship helps connect evaluations to employees.
Relationship 2: TABLE EMPLOYEE[EMPLOYEE_NO] links to TABLE TEST[EMPLOYEE_NO].

This relationship helps identify which employees have corresponding entries in TABLE TEST.

 

 

rajendraongole1_0-1730871989399.png

 

 

rajendraongole1_1-1730872296950.png

 

 

CountMissingEvaluationIDs =
CALCULATE(
    COUNTROWS('TABLE EVALUATION'),
    FILTER(
        'TABLE EVALUATION',
        VAR EmpNo = LOOKUPVALUE(
            'TABLE EMPLOYEE'[EMPLOYEE_NO],
            'TABLE EMPLOYEE'[ID], 'TABLE EVALUATION'[EMPLOYEE_ID]
        )
        RETURN
            ISBLANK(
                LOOKUPVALUE(
                    'TABLE TEST'[ID],
                    'TABLE TEST'[EMPLOYEE_NO], EmpNo
                )
            )
    )
)
 
Hope this helps.




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

Proud to be a Super User!





@rajendraongole1 I'll try this and get back to you.

Hi @RanHo 

 

Thanks for the reply from FreemanZ , rajendraongole1 and shafiz_p .

 

Do the methods solve your problem? If so, could you please mark helpful answers as solutions? This will help more users who are facing the same or similar difficulties. Thank you!

 

If the problem is not solved , please try the following measure.

Count = 
COUNTROWS (
    EXCEPT (
        SELECTCOLUMNS ('TABLE EVALUATION', "EVALEVALUATION", 'TABLE EVALUATION'[ID]),
        SELECTCOLUMNS ('TABLE TEST', "EVALEVALUATION1", 'TABLE TEST'[ID])
    )
)

 

Output:

vxuxinyimsft_0-1732006579298.png

 

Best Regards,
Yulia Xu

 

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

FreemanZ
Super User
Super User

hi @RanHo ,

 

how are the three tables related?

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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