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
Brubaker2112
Regular Visitor

Date Filter - As At Date between a start and end date

I have a dataset that contains cover from and cover to dates.  I would like to be able to filter these down, ideally with a slicer, such that I can select a date and then dynamically calculate whether that selected date is between the cover from and cover to dates.

 

I have got as far as creating a separate date table and producing a measure that represents the SelectedDate when a single date value is picked but I am having trouble getting the dynamic calculation to recognise this selected date.

1 ACCEPTED SOLUTION

Hi @Brubaker2112 ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Brubaker2112 ,

I still have a little confused about your scenario.

If it is convenient, could you share some data sample which could reproduce your scenario and your desired output so that we could help further on it.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

A cut down sample of my data would be as below - I am trying to create the column "LiveAsAtDate" to work dynamically with a change in slicer (which has a selection of dates in it).  In Excel this would basically be an IF(DateFrom<AsAtDate,If(DateTo>AsAtDate,"Yes","No"),"No").

 

As At Date16/03/2019  
    
RecordDate FromDate ToLiveAsAtDate
101/01/201931/12/2019Yes
201/01/201928/02/2019No
301/03/201928/02/2020Yes
401/04/201906/09/2019No
515/03/201931/12/2019Yes
614/06/201915/06/2021No

Hi @Brubaker2112 ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Cherry,

 

This has done the job.

Hi @Brubaker2112 ,

You're welcome!Smiley Wink

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Brubaker2112 ,

Assuming that the As at date is the selectedvalue from date slicer.

Then you could create the measure below to achieve your desired output.

Measure 2 =
VAR a =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    IF (
        MAX ( 'Table3'[Date From] ) < a,
        IF ( MAX ( 'Table3'[Date To] ) > a, "Yes", "No" ),
        "NO"
    )

Here is the output.

Untitled.png

In addition, you could refer to my attachment.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.