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

Can I filter a table with a date slicer and get the records that are OUTSIDE the selected date range

I have a dataset with members and the date of their last purchase. I'm trying to identify those members who do NOT have a purchase date in the period selected with the slicer.

 

For example:

Member XYZ's last purchase date is 12/20/2020.

This member would be excluded from my output with a slicer selection of 1/1/2020 thru 12/31/2020 because their last purchase was  made in that window. However, they WILL be in my resultset if the slicer selection is 1/1/2020 thru 11/30/2020 because they did NOT make a purchase during those dates.

 

FYI I'm nearly bald from tearing my hair out over this. Any help is greatly appreciated!

 

P.S. I have control over the underlying dataset. If I should gather the information differently, I can.

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

Hi @dianrob1464,

You can create an unconnected date table as the source of the slicer, then you can write a measure as a filter to use on the 'visual level filter' to filter your visual records:

Not In Range=
VAR selectedRange =
    ALLSELECTED ( Selector[Date] )
VAR currPurchase =
    MAX ( Table[PurchaseDate] )
RETURN
    IF ( currPurchase IN selectedRange, "N", "Y" )

Applying a measure filter in Power BI - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @dianrob1464,

You can create an unconnected date table as the source of the slicer, then you can write a measure as a filter to use on the 'visual level filter' to filter your visual records:

Not In Range=
VAR selectedRange =
    ALLSELECTED ( Selector[Date] )
VAR currPurchase =
    MAX ( Table[PurchaseDate] )
RETURN
    IF ( currPurchase IN selectedRange, "N", "Y" )

Applying a measure filter in Power BI - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
DJLight890
Helper II
Helper II

Hey, I'm still somewhat new to PowerBI, but hopefully this is something that may help.

I used some simple project management mockup data I had to help provide a screenshot to a solution. In my mockup, I have 3 workers that charged time to a couple of projects. However on 01/06/2022 I have two workers that did not submit time, but I would want to include that in my table so managers could see who did NOT submit time yet.

 

Clicking on the table, I then right-clicked on the "worker" item in the values and selected the option at the bottom to "Show items with no data". Now my table shows the other 2 workers with no time charged to projects.

Show items with no data.png

 

I hope that helps.

Thank you, I appreciate your response; however, I failed to mention that I only want the ones NOT found in the slicer date range. I do not want those that are in the date range, kind of an exception report I suppose. I'm going to investigate your suggestion a bit more to see if I can leverage it for a solution. 

Hi,

I'd like to help.  Please share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Oh I'm sorry, my mistake. What you wrote made sense, I just didn't read it correctly. I will take a look too to see what I can find. I'm still somewhat new and this could be useful for me too.

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.