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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
hallang
Frequent Visitor

Showing count of new start employees by month

Hi,

I am trying to add a 'card' to show the number of new start employees in any current month.  I ahve copied a formula from google but it doesnt seem to be working -

New Start Employee Count =
VAR CurrentMonthStart = STARTOFMONTH(TODAY())
VAR CurrentMonthEnd = ENDOFMONTH(TODAY())
RETURN
CALCULATE(
    COUNTROWS(Sheet1),
    Sheet1[start date ] >= CurrentMonthStart,
    Sheet1[start date ] <= CurrentMonthEnd
)
 
Can anyone suggest how I can do this?
1 ACCEPTED SOLUTION
BenjaminSNN
Frequent Visitor

Hey!

I think STARTOFMONTH() and ENDOFMONTH() can only be used in a table context. You should use EOMONTH(). 
I've altered the code for you:

New Start Employee Count =
VAR CurrentMonthStart = EOMONTH(TODAY(), -1) + 1 // End of last month plus one day is first of this month
VAR CurrentMonthEnd = EOMONTH(TODAY(), 0)

RETURN
CALCULATE(
    COUNTROWS(Sheet1),
    Sheet1[start date ] >= CurrentMonthStart,
    Sheet1[start date ] <= CurrentMonthEnd
)

View solution in original post

2 REPLIES 2
BenjaminSNN
Frequent Visitor

Hey!

I think STARTOFMONTH() and ENDOFMONTH() can only be used in a table context. You should use EOMONTH(). 
I've altered the code for you:

New Start Employee Count =
VAR CurrentMonthStart = EOMONTH(TODAY(), -1) + 1 // End of last month plus one day is first of this month
VAR CurrentMonthEnd = EOMONTH(TODAY(), 0)

RETURN
CALCULATE(
    COUNTROWS(Sheet1),
    Sheet1[start date ] >= CurrentMonthStart,
    Sheet1[start date ] <= CurrentMonthEnd
)

Hi!

 

That seems to work perfectly! Thank you so much!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors