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
Zahoul
Frequent Visitor

Use a date slicer to filter on a period instead of a single date

Hello,

 

I face an issue in my report.

 

Here is an example of a dataset I have (dates are in dd/MM/yyyy):

 

CodeStart dateEnd dateTitle
110/01/201920/01/2019My first loan
225/12/201812/01/2019My second loan
328/12/201805/02/2019My third loan
421/01/201908/02/2019My fourth loan

 

I use a date slicer (based on a Calendar table) and the calendar table is linked to the Start date of my dataset.

If I choose 01/01/2019 - 31/12/2019 in the date slicer, the system will return line 1 and 4.

But in my case I want all loans that live in the period. All 4 loans exist at some point in january.

 

However my date slicer can be linked to one column only and I don't see how I could manage to have all 4 results with a single date slicer.

 

Would there be a way to achieve this?

 

Many thanks in advance,

 

Julien

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Zahoul,

 

Disable the relationship, drag measure below to Visual level filters and set Show items when the value is 1.

Measure =
IF (
    SELECTEDVALUE ( Table1[Start date] ) <= MAX ( 'Calendar'[Date] )
        && SELECTEDVALUE ( Table1[End date] ) >= MIN ( 'Calendar'[Date] ),
    1
)
Community Support Team _ Sam Zha
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

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Zahoul,

 

Disable the relationship, drag measure below to Visual level filters and set Show items when the value is 1.

Measure =
IF (
    SELECTEDVALUE ( Table1[Start date] ) <= MAX ( 'Calendar'[Date] )
        && SELECTEDVALUE ( Table1[End date] ) >= MIN ( 'Calendar'[Date] ),
    1
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-chuncz-msft ,

Can the measure be done without the SELECTEDVALUE function? I don't have it in my tabular version...

 

Hi @Anonymous 

Instead of this:

SELECTEDVALUE ( Table1[Start date] )

try this, which should be equivalent:

IF ( HASONEVALUE ( Table1[Start date] ), VALUES( Table1[Start date]) ) 

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

Hello Sam,

 

Thank you very much for your help, it seems to do the job!

 

Julien

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.