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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.