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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Use slicer to exclude and show rows excluded

I want the slicer to display all the customers that have not been visited between a certain period- 

 

I have a calculated column 

LastVisitDate = MAXX(FILTER('All calls', 'All calls'[customer ID]= EARLIER('All calls'[customer ID])), ''All calls'[Date])
 
I tried calculating a column but the result is always "No" . I have added a "between" slicer too
 
Not Visited = IF ( ISBLANKCALCULATE ( MAX ( 'All calls'[Date]) ), FILTER (  'All calls'YEAR ( 'All calls'[Date] ) = YEAR ( 'All calls'[LastVisitDate] ) &&  MONTH ( 'All calls'[Date] ) = MONTH ('All calls'[LastVisitDate] ) &&  'All calls'[customer ID] = EARLIER('All calls'[customer ID]) ) ), "Yes" "No" )
 
I tried finding the solution but couldn't figure out how to apply them to my own case- I would appreciate your help!
1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

You can create measures to achieve your desired results.

Here are the steps you can follow:

1. You need to create a table of unrelated dates to act as a slicer.

 

Date=
CALENDAR(
    DATE(
        2021,1,1),
    DATE(
        2021,4,1))

 

vyangliumsft_2-1708479604791.png

2. Create measure.

 

Flag =
var _mindate=MINX(ALLSELECTED('Date'),'Date'[Date])
var _maxdate=MAXX(ALLSELECTED('Date'),'Date'[Date])
return
IF(
    MAX('All calls'[customer ID]) in SELECTCOLUMNS(FILTER(ALL('All calls'),'All calls'[Date]>=_mindate&&'All calls'[Date]<=_maxdate),"test",'All calls'[customer ID])
,1,0)

 

 

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_3-1708479616069.png

4. Result:

 

vyangliumsft_0-1708479667006.png

 

Best Regards,

Liu Yang

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

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

You can create measures to achieve your desired results.

Here are the steps you can follow:

1. You need to create a table of unrelated dates to act as a slicer.

 

Date=
CALENDAR(
    DATE(
        2021,1,1),
    DATE(
        2021,4,1))

 

vyangliumsft_2-1708479604791.png

2. Create measure.

 

Flag =
var _mindate=MINX(ALLSELECTED('Date'),'Date'[Date])
var _maxdate=MAXX(ALLSELECTED('Date'),'Date'[Date])
return
IF(
    MAX('All calls'[customer ID]) in SELECTCOLUMNS(FILTER(ALL('All calls'),'All calls'[Date]>=_mindate&&'All calls'[Date]<=_maxdate),"test",'All calls'[customer ID])
,1,0)

 

 

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_3-1708479616069.png

4. Result:

 

vyangliumsft_0-1708479667006.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.