cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
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
)
2 REPLIES 2
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
)
Frequent Visitor

Hi!

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors