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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Rich2852
Frequent Visitor

Apply an OR filter when using a slicer

I have a matrix table that I want to filter based on a date slicer on a set of customers. However, I have another field that if its null/blank I would like the filter to not touch regardless of the date on the filter. 

 

For example 

 

ID         Val               DateField

1            3                   2007-01-01

2            2                  2005-01-01

3            2                  2001-01-01

4                                1999-01-01

 

If I have a DateField slicer and I set it to  2004-12-31 I'd like the following results:

 

ID         Val               DateField

1            3                   2007-01-01

2            2                  2005-01-01

4                                1999-01-01

 

ID1 is selected because the DateField is greater than the selected date 

ID2 is selected because the DateField is greater than the selected date 

ID4 is selected not because the datefield is greater but because the Val field is blank.

 

I'm basically requiring an OR statement on the slicer. 

Any ideas?

 

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

Hi @Rich2852

You could create a date table, then edit relationship with your data table, next add the "date" column to a slicer

Table = CALENDARAUTO()

4.png

 

 

2. create a measure in your data table, then add this measure to the Visula level filter and set "show data when value equal: 1".

Measure = IF(MAX([DateField])>SELECTEDVALUE('Table'[Date])||MAX([Val])=BLANK(),1,0)

3.png

 

 

Best Regards

Maggie

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Rich2852

You could create a date table, then edit relationship with your data table, next add the "date" column to a slicer

Table = CALENDARAUTO()

4.png

 

 

2. create a measure in your data table, then add this measure to the Visula level filter and set "show data when value equal: 1".

Measure = IF(MAX([DateField])>SELECTEDVALUE('Table'[Date])||MAX([Val])=BLANK(),1,0)

3.png

 

 

Best Regards

Maggie

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.