cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Creating headcount growth adding each month hires to previous (line chart)

Hi, this should be fairly easy, but I am a beginner!

My data has hire month for employees,

• I want to show a liner headcount of total employees each month
For example before year 2022 we have 100 employees already, how can this be more user friendly to be changed by the user?

Example

 Employee Hire date Other filter Worker 1 01/02/2022 Filled Worker 2 01/02/2022 Accepted Worker 3 02/11/2022 Filled Worker 4 03/22/2022 Filled Worker 5 03/25/2022 Filled

What I need is to show is Total Head Count measure.. for Jan = 102, Feb = 103, Mar = 105 (so it adding number of hires from previous months)

I have a DateDim table... (if that's useful?)

Also, what if I want to calculate only the ones that are (Filled)?

2 REPLIES 2
Frequent Visitor

@amitchandak thank you for your quick response..

I do not have termination date, and I tried your calculation like this:

HireTotals = CALCULATE(Count('Table'[Hire date]),filter(DimDate,DimDate[Date] <=maxx(DimDate,DimDate[Date]))) + [initial Emp]

And I got this (total by month) not the (total year to date) = adding totals per month

I tried to use the quick measure function to measure YTD and it came up with this expression

Hire date YTD =
IF(
ISFILTERED('Table'[Hire date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
TOTALYTD(
COUNTA('Tabel'[Hire date]),
'Table'[Hire date].[Date]
)
It worked on it's own but it won't change based on other visuals and gives the error msg

Any thoughts?

Thank you!

Super User

@NovWor , if we have hire and termination date both then we use, log like the one here

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

else we use logic like

[Intial Emp] + CALCULATE(Count(Hire[EmpID]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(leaver[leaver]),filter(date,date[date] <=maxx(date,date[date])))

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors