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
LyonsBI_BRL
Helper III
Helper III

Count Number of Rows - Based on Start Date

I have rather an interesting challenge I'm looking at here. I need to calculate the number of employees who have started each month. And I need to also calculate the number of employees who have completed their assignement each month. I need to figure out how would I count the number of rows who have started during the month, the number of rows of people who have left or wil be leaving that month, and what my running total is each month.

 

LyonsBI_BRL_0-1637102979862.png

 

1 ACCEPTED SOLUTION

Hi,

I am not sure whether I understood your question correctly, but please check the below picture and the attached pbix file.

All measures are in the attached pbix file.

 

Picture1.png

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your data model looks like, but I suggest having a dim-calendar table like below.

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Employees count: =
IF (
HASONEVALUE ( 'Calendar'[Month & Year] ),
CALCULATE (
COUNTROWS ( Data ),
FILTER (
Data,
MIN ( 'Calendar'[Date] ) <= Data[dateEnd]
&& MAX ( 'Calendar'[Date] ) >= Data[dateBegin]
)
)
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim That worked!

 

Is there a way I can see the net difference between each month from month to month?

 

LyonsBI_BRL_0-1637128723846.png

 

Hi,

I am not sure whether I understood your question correctly, but please check the below picture and the attached pbix file.

All measures are in the attached pbix file.

 

Picture1.png

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.