I had a similar task, and in the end I got the following solution:
SUM(
[EmployeeChanging].[EmployeeChanging].[EmployeeChanging].Members,
IIF(
[Measures].[EmployeeFrom] <= [Measures].[MaxDay]
and
[Measures].[EmployeeTo] >= [Measures].[MinDay],
[Measures].[EmployeeChangingCount],
NULL
)
)
There is a dim / fact table in the following format:
EmployeeID + StartDate + EndDate
EmployeeChanging, - EmployeeID + StartDate , , [Measures]. [EmployeeFrom], [Measures]. [EmployeeTo], [Measures]. [EmployeeChangingCount] max, max, count aggregations. , [Measures]. [MaxDay] [Measures]. [MinDay] Date . .
, EmployeeChanging, MDXing.