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 need to calculate a moving average over time, i need to get the no of employees at a point in time.
i have a start date and i have an employee end date, how do i calculate the moving average over time, taking into consideration i am plotting on 2 different dates for the above?
currently i have this but it doesn't seem to work
No of Current Employees = CALCULATE(DISTINCTCOUNT('Employees All Time'[Employee No.]),
FILTER('Employees All Time',
min('Date'[Date]) >= 'Employees All Time'[Start Date]
&& MAX('Date'[Date]) < 'Employees All Time'[Leaving Date] )
)
this should give me a total at a day level.
however i am also stuck as to how to calculate the average.
it doesn't return anything which is quite frustrasting help please 🙂
Proud to be a Super User!
Hi @vanessafvg,
Could you try the formula below to see if it works in your scenario?
No of Current Employees = VAR currentDate = MAX ( 'Date'[Date] ) RETURN CALCULATE ( DISTINCTCOUNT ( 'Employees All Time'[Employee No.] ), FILTER ( ALL ( 'Employees All Time' ), 'Employees All Time'[Start Date] <= currentDate && 'Employees All Time'[Leaving Date] > currentDate ) )
Regards
thanks will give it a bash
Proud to be a Super User!
Hi @vanessafvg,
Have you tried the solution? Does it work in your scenario? If it works, could you accept it as solution to close this thread?
Regards
hi @v-ljerr-msft i have been working on something else, so can't say if its the solution yet sorry.
Proud to be a Super User!
Proud to be a Super User!
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |