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
alpeytongreene
Helper II
Helper II

Start Date and End Date counting for months in between

I am working on a contract labor dashboard, I need to count the person in contract from their start date through their end date- without having to create multiple entries per each labor.

 

Example:

Bob Smith started 01-01-2021 and ends July 30, 2021- so Bob would count January, February, March, April, May, June, and July 

Sally Sue started February 15 and ends May 15- so Sally would count February, March, April, and May. 

 

It would be filtered multiple ways from the same data. 

 

Is there a way to do this where I would not have to manually update/enter the data for each month? 

5 REPLIES 5
gvrajesh
Frequent Visitor

@alpeytongreene 

Create datetable and measure like below

gvrajesh_1-1614830092884.png

 

gvrajesh_0-1614829877050.png

gvrajesh_2-1614830131264.png

 

 

 

 

 

Will it work if I already have that data in my model just not as a direct table. 

If you've date table...that will work

Anonymous
Not applicable

@gvrajesh What should we join the Date table to on with fact table? Start Date? Or no need to join?

@gvrajesh 

I have the formula set as: 

Count =
VAR Tab =
FILTER('CL Labor Count Table',
'CL Labor Count Table'[Start Date]<= MAX('Date Table'[Date])
&& 'CL Labor Count Table'[End Date]>= MIN('Date Table'[Date])
)
RETURN
CALCULATE(COUNT('CL Labor Count Table'[Lawson ID]), Tab)
 
 
but this is  only showing to the start month. 

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.

Top Solution Authors