Forum Discussion
Power BI - Related / VLOOKUP help
Looking for help - I have two tables data loaded in Power BI: Table one contains training report data with employee IDs, Training Courses, Training Dates, etc. Table two contains a roster for all employee IDs and thier names. A 1-to-many relationship was established based on employee IDs, so i can create a visual to show the names of employees who completed training or have overdue training they have previously taken. The employees who did not accomplish any training are not shown on the training report. I want to create a table visual to show those employees who have not completed any training and the course, however I cannot seem to connect anything back to show or filter out employees who have not done training. Looking to see if there is a way to show this information. Thank you.
Example Table 1 (Training Data)
| Employee ID | Training | Date Completed |
| 1 | Darwin Award Training | 1 Jan 25 |
| 1 | Safety Training | 1 Jan 25 |
| 2 | Darwin Award Training | 1 Jan 25 |
| 6 | Darwin Award Training | 1 Jan 24 |
| 8 | Safety Training | 1 Jan 24 |
Example Table 2 (Employee Roster)
| Name | Employee ID |
| Alfred Pennyworth | 1 |
| Bruce Wayne | 2 |
| Peter Parker | 3 |
| Tony Stark | 4 |
| Ned Stark | 5 |
| Han Solo | 6 |
| Spock | 7 |
| Link | 8 |
Ideal Table Visual View:
| Employee Name | Missing Training |
| Bruce Wayne | Safety Training |
| Peter Parker | Darwin Award Training | Safety Training |
| etc. |
|
Hey Mctwist_720 ,
creating this measure:missing trainings = var allTraining = DISTINCT( ALL( 'Training Data'[Training] ) ) var completedTrainings = VALUES( 'Training Data'[Training] ) var missiingTrainings = EXCEPT( allTraining , completedTrainings ) return IF( COUNTROWS( missiingTrainings ) = 0, "completed all trainings", // replace the string with BLANK() if onyy employess with missing trainings need to be listed CONCATENATEX( missiingTrainings , 'Training Data'[Training], "|", 'Training Data'[Training] , ASC ) )allows me to create this table visual:
Hopefully, this provides what you are looking for.
Regards,
Tom
3 Replies
- TomMartensSuper User
Hey Mctwist_720 ,
creating this measure:missing trainings = var allTraining = DISTINCT( ALL( 'Training Data'[Training] ) ) var completedTrainings = VALUES( 'Training Data'[Training] ) var missiingTrainings = EXCEPT( allTraining , completedTrainings ) return IF( COUNTROWS( missiingTrainings ) = 0, "completed all trainings", // replace the string with BLANK() if onyy employess with missing trainings need to be listed CONCATENATEX( missiingTrainings , 'Training Data'[Training], "|", 'Training Data'[Training] , ASC ) )allows me to create this table visual:
Hopefully, this provides what you are looking for.
Regards,
Tom- Mctwist_720Regular Visitor
Thank you!
- BIswajit_DasImpactful Individual
Hello Mctwist_720
If you want the result in calculated column then you can follow the below attached file.
Thanks & Regards.