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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vinkesh-serene
Frequent Visitor

Get the Power BI report from three related tables.

Hello Everyone,

 

Having some isues creating a Power BI report from three related tables, Scenario is:

I have three tables which are as follows :

1. Staff

2. TrainingTypes

3. StaffTrainingMapper

 

Staff --> Id

TrainingTypes Id, Name

StaffTrainingMapper --> Staff[Id], Training[Id]

 

Attended : Count of staff[Id] in StaffTrainingMapper by Training[Id]

Missing : ?? not sure how to calculate that, Total staff - staff Attended or something.

 

I need a report of staff who attended (Staff with staff ID in StaffTrainingMapper) or missing training (Staff don't have STaff ID in StaffTrainingMapper) for diffrent training types. Output of the report will be something like :

New_Skitch_030416_100246_AM.jpg

2 REPLIES 2
austinsense
Impactful Individual
Impactful Individual

I think is the sort of code that you're looking for, AS MEASURES ...

 

Total Staff = COUNTROWS( Staff)
Attendance = DISTINCTCOUNT ( StaffTrainingMapper[StaffID])
Non-Attendance = [Total Staff] - [Attendance]
Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Hey Austin,

 

Thanks for the response.


One more question I have :
As the [StaffId] from [StaffTrainingMapper] is in relationship with the [Id] from [Staff] table and Training[Id] with [Training] table so it will be easy to get all the records from [StaffTrainingMapper] by [StaffId] and TrainingId (Which staff already takken the training), Though how we can get all the staff from [Staff] table who don't have coprresponding [StaffId] in [StaffTrainingMapper] (Staff who havn't taken the training yet).

 

Thanks in advance.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors