cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

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
secondImage

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors