Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

WORKER EVOLUTION

Hello!

I want to make a visual with the evolution of the workers in my company.

I have a Employment_Date column and a Termination_Date column (if it's empty the worker is still active)

And I have a Calendar from the dates of the contracts (Calendar contracts)

I've made the measurement

Employees by year evolution = CALCULATE(COUNTROWS('1-RRHH TOP MANAGEMENT'),FILTER('1-RRHH TOP MANAGEMENT',[Employment_Date]<MIN('Contract calendar'[Date])&&([Termination_Date]>MAX('Contract calendar'[Date])||[Termination_Date]=BLANK())))
The only mistake I get in the visual is that the employee appears to me only when he or she has been active for a year.
For example: the first two employees of the company have Employment Date in 2008 and in the graph they appear in 2009 and so on with all employees
ElenaCarciLopez_0-1715348467771.png

In 2010 there were 3 employees and this third employee does not appear until 2011

ElenaCarciLopez_1-1715348555695.pngElenaCarciLopez_2-1715348577139.png

Does anyone know where I'm going wrong?

Thank you for your help!!

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi,

It seems you are on the right track, but what about changing the min to max as there is no reason there should be both min and max in the headcount formula.  Please try swapping min with max and you will get the right output, I suppose.  

DataNinja777_0-1715349349245.png

Best regards,

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Hello again, I just saw an error that I get with this formula: I have two employees discharged in May and they don't appear in the graph, does anyone know why?

I'm using this formula:

Employees by year evolution = CALCULATE(COUNTROWS('1-RRHH TOP MANAGEMENT'),FILTER('1-RRHH TOP MANAGEMENT',[Employment_Date]<MAX('Contract calendar'[Date])&&([Termination_Date]>MAX('Contract calendar'[Date])||[Termination_Date]=BLANK())))
DataNinja777
Super User
Super User

Hi,

It seems you are on the right track, but what about changing the min to max as there is no reason there should be both min and max in the headcount formula.  Please try swapping min with max and you will get the right output, I suppose.  

DataNinja777_0-1715349349245.png

Best regards,

Hello again, I have just seen an error that comes out with this formula: the employees who are registered in the month of May do not appear to me, I imagine that they will be in arrears, but could I add something to my formula so that each employee appears at the time of registration, even if it is the same day?

I'm using this formula:

Employees by year evolution = CALCULATE(COUNTROWS('1-RRHH TOP MANAGEMENT'),FILTER('1-RRHH TOP MANAGEMENT',[Employment_Date]<MAX('Contract calendar'[Date])&&([Termination_Date]>MAX('Contract calendar'[Date])||[Termination_Date]=BLANK())))

That's great!!! Works!!!! Thanks a lot!!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.