How to calculate Headcount over time

Hi Frank,

I’ve seen this question a few times and I believe I have the solution for you.

It’s similar to this forum post here.

And here.

It’s all about managing multiple dates in your fact tables like you have here.

I have recently created a video describing how to work with this.

See here…

I have another tutorial being release in the coming weeks around this specific case as well.

But the techniques are all the same.

You need a model that looks like this

image

Then a formula combination like this.

Current Staff = 
CALCULATE( COUNTROWS( 'Staff Population' ),
    FILTER( VALUES( 'Staff Population'[Start Date] ), 'Staff Population'[Start Date] <= MAX( Dates[Date] ) ),
    FILTER( VALUES( 'Staff Population'[End Date] ), OR( 'Staff Population'[End Date] >= MIN( Dates[Date] ), ISBLANK( 'Staff Population'[End Date] ) ) ) )

Check out the resources I’ve placed here and you’ll see exactly what needs to be done for this.

Thanks
Sam