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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Calendar does not relate some tables

Good afternoon to tod@s, a pleasure to enter this forum,

I come across a table relationship problem.

I have the Calendar table, with which I move throughout the model, as far as dates are concerned.

In the canvas I am working on, HR, I use data from an "Employees" table, which, in summary, have the data in columns: ID_empleado, high date, low date, current status template (High or low).

This table is related to one of "Parties", by connecting with the key "Id_Empleado". Then, the "Parts" table is related to another called "work orders", using the key "Id_OT" (each part relates to a Id_OT). And finally, the "work orders" table is related to the "calendar" table by means of the opening date of each OT.

In summary, the relationship that arrives at the "Employees" table is as follows: Calendar ->Work orders -> "Parties" -> "Employees".

In order to count the existing casualties, I use this DAX: calculate(DISTINCTCOUNT(Employees[Id_operario]),Employees[Estado_plantilla]="Low")

However, it doesn't filter me by dates. With the commented DAX: (calculate(DISTINCTCOUNT(Employees[Id_operario]),Employees[Estado_plantilla]="Low"), I enter a time slicer with Date from the DimCalendario[Date], it does not filter me by date. It puts "1" on all the dates in the "Calendar" table.
I have tried to directly relate the Calendar table with that of "Employees" and, obviously, it comes out that the relationship is duplicated, since there is already a connection currently through the "Parts" table.
Could you help me?
Thank you very much in advance.
Greetings to tod@s,
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Syndicate_Admin , Work Order should be the fact

and Calendar, parties, and employees should act as dimensions.

 

Another copy of the employee should be used as a fact and should join with calendar.

 

How employee fact will work, you can check here

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Syndicate_Admin
Administrator
Administrator

Thanks a lot! Resolved! I have been entering the program for a few weeks and there are logic errors that I have a hard time understanding.

Thanks again! Best regards!

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Thanks a lot! Resolved! I have been entering the program for a few weeks and there are logic errors that I have a hard time understanding.

Thanks again! Best regards!

amitchandak
Super User
Super User

@Syndicate_Admin , Work Order should be the fact

and Calendar, parties, and employees should act as dimensions.

 

Another copy of the employee should be used as a fact and should join with calendar.

 

How employee fact will work, you can check here

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (8,094)