Forum Discussion
jonahlawson
3 years agoFrequent Visitor
Rolling Count By Date
I have a data set of a list of people within an organization with columns stating who they are, when they were hired and a column on their temrination date if they left the organization. I am working...
BA_Pete
Super User
3 years agoHi jonahlawson ,
Create a measure something like this (I'm assuming you do not have a relationship between your calendar table and your employees table):
_noofHeadsInOrgOverTime =
VAR __cDate = MAX(calendar[date])
RETURN
CALCULATE(
DISTINCTCOUNT(yourTable[employeeID]),
FILTER(
yourTable,
yourTable[startDate] <= __cDate
&& (youTable[terminationDate] >= __cDate || ISBLANK(youTable[terminationDate]))
)
)
You then use calendar[date] (or calendar[month], calendar[year] etc.) on the axis of any visuals to see the balance at any point in time.
Pete
jonahlawson
3 years agoFrequent Visitor
This works great except a need a way to make it a running/culmative total as time goes on. I have a culmative measure I created "Rolling Total = CALCULATE(DISTINCTCOUNT('Squad Aligment'[Person]), ALL('Squad Calender'), 'Squad Calender'[Date] <=MAX ('Squad Calender'[Date]))", but have yet to find a way to incorpate the subtraction of anyone terminated as well.