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
AnnaKi
Frequent Visitor

Count the number of Employees that started each month

Hi!

I have an "Interval" table between my Date table (DimDate) and my Transactions table.

Each Employee has a DateKey consisting of (Start Date)|(End Date) =  SDate|EDate. Each DateKey has Dates from the SDate to the EDate in the DimDate table.

 

AnnaKi_0-1631627205755.png

 

I want to count the number of EmployeeKeys that have started in each period. So where the "SDate" for an EmployeeKey in the Transactions table is the same as the "Date" in the DimDate table, then the count is one for that period only for that EmployeeKey.

What I am after is the following:

 

AnnaKi_1-1631627883676.png

 

Any ideas?

1 ACCEPTED SOLUTION

I got help from a colleage:
Starters =
VAR selectedDate = MAX('DimDate'[Date])
RETURN
CALCULATE(DISTINCTCOUNT(Employee[EmployeeNo]), Employee[StarterDate] = selectedDate)

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @AnnaKi ,

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

I got help from a colleage:
Starters =
VAR selectedDate = MAX('DimDate'[Date])
RETURN
CALCULATE(DISTINCTCOUNT(Employee[EmployeeNo]), Employee[StarterDate] = selectedDate)

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.