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
Necron35
New Member

If dates one table are between 2 dates on another table return other table related value.

Hi this is my first time posting and im stumbling through my first Power BI project and have run into an issue im not sure how to tackle.

 

I have two tables, one with delay data with delay start and end times and another table with crew data with crew start and end times.

 

I want to add the crew data to the delay table based on if the delay start date falls between the crew start and stop date.

 

All dates are in Time/Date format with 7am and 7pm being the start and stop of shifts.

 

Crew Table

Necron35_0-1703182457563.png

 

Delay Table

Necron35_1-1703182493709.png

 Thank you.

2 REPLIES 2
amitchandak
Super User
Super User

@Necron35 , I case you need additional column

 

maxx(filter(delay, (delay[Start] >= Crew[Start] && Delay[Start] <= Crew[End]) || (delay[End] >= Crew[Start] && Delay[End] <= Crew[End])), [Heat Id])

 

 

You can use count too

@amitchandak 

It might be my lack of experience but i cant get the DAX you suggested to work for two different tables.

 

Is there something i need to do make that happen?

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.