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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

count of employee who have joined in that particular month

Hello Folks,
I am new to PowerBI & Dax, please help me to get this logic for creating New Joiners Measure.

I am trying to calculate Distinct Count of Employee keys (New Employees) for each month based on - DOJ (sample data shown in below table)

MonthEmployee keyDOJ
1/1/2022111113/09/2021
1/1/2022111221/01/2022
1/1/2022111328/01/2022
2/1/2022222215/05/2021
2/1/2022222013/02/2022

 

Output 
MonthNew Joiners
Jan-222
Feb-221

 

Any help or guidance is greatly appreciated.

@ChandeepChhabra @Jihwan_Kim 

 

 

 

Thanks,

Naveen

 

 

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

 

Measure =
CALCULATE (
    COUNT ( 'Table'[Employee key] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Month] ),
        'Table'[DOJ] >= SELECTEDVALUE ( 'Table'[Month] )
    )
)

 

vpollymsft_0-1659678439333.png

If I have misunderstood your menaing, please provide your pbix file without privacy information and desired output with more details.

 

Best Regards
Community Support Team _ Polly

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

 

View solution in original post

3 REPLIES 3
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

 

Measure =
CALCULATE (
    COUNT ( 'Table'[Employee key] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Month] ),
        'Table'[DOJ] >= SELECTEDVALUE ( 'Table'[Month] )
    )
)

 

vpollymsft_0-1659678439333.png

If I have misunderstood your menaing, please provide your pbix file without privacy information and desired output with more details.

 

Best Regards
Community Support Team _ Polly

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

 

Anonymous
Not applicable

Hi Amit,

 

Thanks for the solution, But this is not working on my tables as I cannot use month column from the DATE table as per my other requirements of metrics. 
 Please suggest any other alternative solution by using DAX . 

amitchandak
Super User
Super User

@Anonymous , create a date table with month

 

Addcolumns(calendar(date(2020,01,01), date(2021,12,31) ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])

)

 

 

Create a meausre

 

distinctcount(Table[Employee key])

 

 

Use with month of date table


To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join with DOJ 

 

and then create a measure

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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