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.
I have a table of Employee ids and the day they were hired and the day they left the company. people with null termination date are still working in the company. New employee ids are appended to this table at the end of each month.
I have another table which contains the departments they have worked so far and the day they started work in that department. Here employee ids are duplicable since one's department may have changed within his tenure.
There is a date slicer in my report and using below query im able to count the employees who worked in the company for a selected period.
FTE = var withTdate = COUNTROWS(FILTER(FTE,FTE[Hire Date]<=MIN('Date'[Date]) && FTE[Leavers.Termination Date]>=MAX('Date'[Date])))
Thank you in advance for any support...
Hi @Anonymous ,
By my test, you need to use DISTINCTCOUNT() function. The following formula you can have a try.
I have two tables, “Function ”and “Table”. There isn’t a relationship between them.
Employee Count =
CALCULATE (
DISTINCTCOUNT ( Function[Employee ID] ),
FILTER (
Function,
Function[Hire Date] <= MIN ( 'Table'[Date].[Date] )
&& Function[Leavers.Termination Date] >= MAX ( 'Table'[Date].[Date] )
)
)
If you have any other questions, please post your expected result and your table “Date” which will make us to help you quickly.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I re-edited my original question. hope now you can understand my requirement better.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |