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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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