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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Portrek
Resolver III
Resolver III

Compare two columns from differents tables with filters

I have two tables, the first contains all the company's employees and their respective data, the second has only two columns, the first is the record number and the second contains the training carried out by the employee, so the number of records is repeated in the first column if the employee has done more than one training. I need to compare the two and show the employees who have not done any training. Question: How do I compare the registration columns of the two tables and show employees who have not undergone a specific training?

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Portrek 

Try:
first the model:

model.JPG

 

Then the following measures:

 

Names =
VAR EMP =
    CALCULATE (
        MAX ( 'Employee Table'[Name] ),
        TREATAS (
            VALUES ( 'Employee Table'[Employee ID] ),
            'Training Table'[Employee ID]
        )
    )
RETURN
    EMP

 

and

 

Pending Training =
VAR employee =
    VALUES ( 'Employee Table'[Employee ID] )
VAR training =
    VALUES ( 'Training Table'[Employee ID] )
RETURN
    COUNTROWS ( EXCEPT ( employee, training ) )

 

Add the Employee ID form the employee table, the [Names] measure and the 'Training Table' [Training] column to the table visual. Add the [Pending Training] measure to the filters on the visual in the filter pane and you get this:
result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

@Portrek 

Try:
first the model:

model.JPG

 

Then the following measures:

 

Names =
VAR EMP =
    CALCULATE (
        MAX ( 'Employee Table'[Name] ),
        TREATAS (
            VALUES ( 'Employee Table'[Employee ID] ),
            'Training Table'[Employee ID]
        )
    )
RETURN
    EMP

 

and

 

Pending Training =
VAR employee =
    VALUES ( 'Employee Table'[Employee ID] )
VAR training =
    VALUES ( 'Training Table'[Employee ID] )
RETURN
    COUNTROWS ( EXCEPT ( employee, training ) )

 

Add the Employee ID form the employee table, the [Names] measure and the 'Training Table' [Training] column to the table visual. Add the [Pending Training] measure to the filters on the visual in the filter pane and you get this:
result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Perfect !!! Thank you !!

PaulDBrown
Community Champion
Community Champion

Can you provide a sample (fake) dataset tonwork with please? And a depiction of how the model is set p





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hello, PaulDBlown. Thanks for the feedback.


Basically I have two tables, the first contains data for all employees of the company and the second contains two columns, the ID and the training carried out by him. However, in the second table, the ID data is repeated according to the number of training sessions performed by the employee, becoming more or less as the table below.

Table 01

Sem título1.pngSem título2.png

Basically, i want to compare the ID the table 01 with th table 02 and show the employees that didn't do especific training.


Can you help me ?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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