Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
4 years ago
Solved

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 Replies