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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Diana_Jardim100
Frequent Visitor

Need some help.

Hi everyone. 

Please I need some help.

 

Currently I have a dataset which contains the Headcount of the company by month.

I need to display the total of people that joined and left the company monthly and the total of headcount by month as well.

Diana_Jardim100_0-1666965667700.png

 

The problem is there are some people that joined the company as a contractor and then became permanent.

So here I have an example:

First as a contractor then as a permanent.

Row Data

Diana_Jardim100_3-1666965766416.png

In order to display the count of people that joined and left the company monthly I need to figure out how to ignore the last date (04/06/2022) and consider the first date (04/06/2021)

Another thing, I also need to take into account  that in this particular case  they didn’t leave the company so I also can’t count this in leavers.

On the other hand, the are some people that have actually left so I will need to consider the newer date and  discard the oldest.  

Diana_Jardim100_2-1666965667703.png

 

And finally, I don’t know how to sum the total of the previous month with the current month to have the total of headcount.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Ok please try 

 

Summary = SUMMARIZE(TotalActivosSaidas,TotalActivosSaidas[ID_EMPREGAD]"First Start Date"CALCULATE(FIRSTDATE(TotalActivosSaidas[DAT_INI_ACT_EMP]),TotalActivosSaidas[DAT_INI_ACT_EMP] = MAX(TotalActivosSaidas[DAT_INI_ACT_EMP]), "Last day"CALCULATE(LASTDATE(TotalActivosSaidas[DAT_SAID]),TotalActivosSaidas[DAT_SAID] =max(TotalActivosSaidas[DAT_SAID]))))

View solution in original post

9 REPLIES 9
v-jianboli-msft
Community Support
Community Support

Hi @Diana_Jardim100 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

hello @Diana_Jardim100  i think a summarized table could help 
summary of table = summarize(table,[ID_EMPREGAD], "First Start Date",calculate(firstdate(dat_ini_act_emp)FILTER(table,dat_ini_act_emp = max(dat_ini_act_emp)),"Last day",calculate(lastdate(dat_said_one_hr),FILTER(table,dat_said_one_hr = max(dat_said_one_hr))

First Many thanks.

I'm almost there 🙂

I don't know what I'm doing wrong but it has return this message.

The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

 

Summary = SUMMARIZE(TotalActivosSaidas,TotalActivosSaidas[ID_EMPREGAD], "First Start Date", CALCULATE(FIRSTDATE(TotalActivosSaidas[DAT_INI_ACT_EMP]),FILTER(TotalActivosSaidas,TotalActivosSaidas[DAT_INI_ACT_EMP] = MAX(TotalActivosSaidas[DAT_INI_ACT_EMP])), "Last day", CALCULATE(LASTDATE(TotalActivosSaidas[DAT_SAID]),FILTER(TotalActivosSaidas,TotalActivosSaidas[DAT_SAID] =max(TotalActivosSaidas[DAT_SAID])))))

 

 

 

 

 

 

 

 

 

 

 

 

Anonymous
Not applicable

Ok please try 

 

Summary = SUMMARIZE(TotalActivosSaidas,TotalActivosSaidas[ID_EMPREGAD]"First Start Date"CALCULATE(FIRSTDATE(TotalActivosSaidas[DAT_INI_ACT_EMP]),TotalActivosSaidas[DAT_INI_ACT_EMP] = MAX(TotalActivosSaidas[DAT_INI_ACT_EMP]), "Last day"CALCULATE(LASTDATE(TotalActivosSaidas[DAT_SAID]),TotalActivosSaidas[DAT_SAID] =max(TotalActivosSaidas[DAT_SAID]))))

same error 

Anonymous
Not applicable

Do you mind sharing some sample data to help you?

Anonymous
Not applicable

is this the result you desire?

Summary = SUMMARIZE(ALL(Diana),Diana[ID_EMPLOYEE],"Start Date",CALCULATE(MIN(Diana[INITIAL_DATE])),"End Date",CALCULATE(MAX(Diana[END_DATE])))

 

Screenshot 2022-10-31 184013.png

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.