The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 :
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]
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.