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
corange
Post Patron
Post Patron

Employee Start of FY

Hi Power BI Team, 

 

Could someone help me fix my below formula so it will count the number of employee at the start of a new FY: 

 

EmployeeStartYear =
VAR MaxDate = STARTOFYEAR('Calendar'[Date])
VAR EMPCOUNT =
CALCULATE(COUNTROWS(CALCULATETABLE(Drivers, Drivers[StartDate] <= MaxDate, ALL ('Calendar'[Date]))),
(ISBLANK(Drivers[FinishDate])|| Drivers[FinishDate] > MaxDate))
RETURN IF(ISBLANK(EMPCOUNT), 0, EMPCOUNT)
 
With the above formula, I obtained the following value for EmployeeStartYear. The number should be the same throughout the entire financial year. However, it changes in January in both instance which tells me it is not correct. Thank you. 
 
Capture22.PNG
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @corange ,

I updated the formula of measure "EmployeeStartYear" and "Employee Count EndofYear", please check whether they are what you want. You can check the details in the updated report file.

EmployeeStartYear =
VAR MaxDate = CALCULATE(MIN('Calendar'[Date]),ALLEXCEPT('Calendar','Calendar'[FY]))//STARTOFYEAR('Calendar'[Date])
VAR EMPCOUNT =
CALCULATE(COUNTROWS(CALCULATETABLE('Sample', 'Sample'[StartDate] <= MaxDate, ALL ('Calendar'[Date]))),
(ISBLANK('Sample'[FinishDate])|| 'Sample'[FinishDate] > MaxDate))
RETURN IF(ISBLANK(EMPCOUNT), 0, EMPCOUNT)
Employee Count EndofYear =
VAR MaxDate = CALCULATE(MAX('Calendar'[Date]),ALLEXCEPT('Calendar','Calendar'[FY]))//ENDOFYEAR('Calendar'[Date])
VAR EMPCOUNT =
CALCULATE(COUNTROWS(CALCULATETABLE('Sample', 'Sample'[StartDate] <= MaxDate, ALL ('Calendar'[Date]))),
(ISBLANK('Sample'[FinishDate])|| 'Sample'[FinishDate] > MaxDate))
RETURN IF(ISBLANK(EMPCOUNT), 0, EMPCOUNT)

Employee Start of FY.JPG

Best Regards

Rena

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@corange , You can use startofyear in your calendar and compare it with that.

 

If you want to repeat then you need to have it enddate and you can use CLOSINGBALANCEYEAR , there is OPENINGBALANCEYear, but that also work on the last date of last year

 

The option is firstnonblankvalue too

I posted 2 video's on that

https://www.facebook.com/watch/?v=295771268202058

https://www.facebook.com/watch/?v=343509629992272

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Mariusz
Community Champion
Community Champion

Hi @corange 

 

You can use the second paramiter in STARTOFYEAR function to set the start of financial Year

 

https://dax.guide/startofyear/ 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi Mariusz, 

 

I am still a beginner in the area so was wondering if you could show me exactly how this would look like in my formula? 

 

Also, what if there is more than one FY, how do I set up the date? 

 

Thank you. 

Anonymous
Not applicable

Hi @corange ,

You can refer the following blog to adjust the calendar table. If it still not working, please provide some original sample data and your expected result in order to provide you solution suitable for your scenario. Thank you.

Financial Year Calculation In Excel and Power BI

Best Regards

Rena

Hi @Anonymous, 

 

Please find my sample via the following link: https://1drv.ms/u/s!AiS7XVNuQsBCcllNYN9yYB8RBEM?e=88sub9 

 

I am trying to calculate the turnover rate for the FY. I am based in Australia so it goes from July to June and the calculation will be use across multiple financial year. I refered to the article you have posted and I am prety sure I have used it in the past to help me. 

 

What is happening is that the calculation EmployeeStartYear should be the same across the entire FY - e.g. 2019 - 2020 - 189 employees. However, as we go through the year, it always update when we hit January which then mean that my yearly average to calculatge the turnover isnt accurate. 

 

Capture26.PNG

Thanks in advance for your help. 

Anonymous
Not applicable

Hi @corange ,

I updated the formula of measure "EmployeeStartYear" and "Employee Count EndofYear", please check whether they are what you want. You can check the details in the updated report file.

EmployeeStartYear =
VAR MaxDate = CALCULATE(MIN('Calendar'[Date]),ALLEXCEPT('Calendar','Calendar'[FY]))//STARTOFYEAR('Calendar'[Date])
VAR EMPCOUNT =
CALCULATE(COUNTROWS(CALCULATETABLE('Sample', 'Sample'[StartDate] <= MaxDate, ALL ('Calendar'[Date]))),
(ISBLANK('Sample'[FinishDate])|| 'Sample'[FinishDate] > MaxDate))
RETURN IF(ISBLANK(EMPCOUNT), 0, EMPCOUNT)
Employee Count EndofYear =
VAR MaxDate = CALCULATE(MAX('Calendar'[Date]),ALLEXCEPT('Calendar','Calendar'[FY]))//ENDOFYEAR('Calendar'[Date])
VAR EMPCOUNT =
CALCULATE(COUNTROWS(CALCULATETABLE('Sample', 'Sample'[StartDate] <= MaxDate, ALL ('Calendar'[Date]))),
(ISBLANK('Sample'[FinishDate])|| 'Sample'[FinishDate] > MaxDate))
RETURN IF(ISBLANK(EMPCOUNT), 0, EMPCOUNT)

Employee Start of FY.JPG

Best Regards

Rena

Hi @Anonymous , 

 

This worked perfectly. Thank you. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors