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

Filter Jobs in between the start date and end date

Hi,

 

I have an issue with my calculation which I am not sure what went wrong.

Firstly, I have this set of data,

Afiq_Danial_0-1668053298637.png

 

I have a filter table by Month, and Year.

Afiq_Danial_2-1668053497810.png

When I selected the June, 2021 filter, it would provide only Job A as it should be because Job A was taking place in that period. It should display like this.

Afiq_Danial_3-1668053594478.png

 

 

However, I realised when I took away the Start Date column from the table, it would be showing both Job A and Job B.

Afiq_Danial_4-1668053685212.png

 

My calculation to get the ongoing job between the start and end date is:

M Filter Recovery Date =

IF (
SELECTEDVALUE('Staff Booking'[Start Date]) <= MAX ( 'Job Calendar'[Job Duration] )
&& SELECTEDVALUE ( 'Staff Booking'[End Date] ) >= MIN ( 'Job Calendar'[Job Duration]),
1
)

 

Can anyone tell me where i went wrong in my calculation? 

 

Thank you very much, really appreciate all the help i can get.

 

1 REPLY 1
HoangHugo
Solution Specialist
Solution Specialist

Hi

Maybe when you remove Start Date, SELECLTEDVALUE([('Staff Booking'[Start Date]) =BLANK, ~ 1/1/1990, so the condition of start date of Job B will be true. Otherwise, if have Stardate, Stardate of Job B >=MAX ( 'Job Calendar'[Job Duration] , so it's false.

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.