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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Finding the Date Range

Hi community, I need help on how to complete my task. I was a given a dataset where it displays the job start date and end date for each staff. However, the data does not consist of the dates in which they are free and are not given any projects.

 

 

123.JPG

 

I want to create two new columns in which it shows the start date and end date of when they are not given any task and are free. For example, the staff Michael does not have tasks from 24 January to 28 January and staff John does not have tasks from 21 January to 24 January. In Michael’s scenario, I believe that there are additional calculations to be made since there are 2 jobs given to him which overlaps. So we’ll have to find the correct date for which Michael are not given any task.

The below table is what I hope to achieve where I can have some calculations in my measures instead of manually entering the date in which the staffs are not given any task

 

Capture.JPG

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

maybe you can try this to create two columns

Column = 
VAR _next=minx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[Start]>EARLIER('Table'[Start])),'Table'[Start])
return if(_next<='Table'[End],blank(),'Table'[End]+1)

Column 2 = 
VAR _next=minx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[Start]>EARLIER('Table'[Start])),'Table'[Start])
return if(ISBLANK('Table'[Column]),BLANK(),_next-1)

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User
Super User

@Anonymous 

maybe you can try this to create two columns

Column = 
VAR _next=minx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[Start]>EARLIER('Table'[Start])),'Table'[Start])
return if(_next<='Table'[End],blank(),'Table'[End]+1)

Column 2 = 
VAR _next=minx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[Start]>EARLIER('Table'[Start])),'Table'[Start])
return if(ISBLANK('Table'[Column]),BLANK(),_next-1)

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.