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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Filter table date with Isfiltered

HI Team,

 

I have below table

 

DateCommentsCategory
1/1/2023HellloA
1/1/2023HiiiiiiA
2/1/2023Hello,testingB
3/1/2023hellllllA

 

If a slicer is filtered then show only rows where date is 16 days from today else show everything. 

How to achive this using a measure??

@tamerj1  @Fowmy  

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

1st create a separate slicer table using table functions. E.g.

ValtteriN_0-1705430635560.png

 

Then create a measure like this:

FIlter if is filtered = IF(OR(ISFILTERED('Slicer table'[Comments]),ISFILTERED('Slicer table'[Category])),
IF(COUNTROWS(FILTER('Table (21)', [Date]>=TODAY() && [Date]<=TODAY()+16))>0,1,0)
,1)

Now place it into a visual like this:

ValtteriN_1-1705431035738.png

 

Then If you select a slicer from the slicer table the measure will work:

ValtteriN_2-1705431077670.png

To get the slicers to function with your table e.g. so that category slices category from your fact table repeat the logic like this:

Category slicer = IF(
    ISFILTERED('Slicer table'[Category]),IF(
    MAX('Table (21)'[Category])=MAX('Slicer table'[Category]),1,0),1)

 

ValtteriN_3-1705431284684.png

 

Now the previously shown row is not shown since the row had category = A.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/









Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

1st create a separate slicer table using table functions. E.g.

ValtteriN_0-1705430635560.png

 

Then create a measure like this:

FIlter if is filtered = IF(OR(ISFILTERED('Slicer table'[Comments]),ISFILTERED('Slicer table'[Category])),
IF(COUNTROWS(FILTER('Table (21)', [Date]>=TODAY() && [Date]<=TODAY()+16))>0,1,0)
,1)

Now place it into a visual like this:

ValtteriN_1-1705431035738.png

 

Then If you select a slicer from the slicer table the measure will work:

ValtteriN_2-1705431077670.png

To get the slicers to function with your table e.g. so that category slices category from your fact table repeat the logic like this:

Category slicer = IF(
    ISFILTERED('Slicer table'[Category]),IF(
    MAX('Table (21)'[Category])=MAX('Slicer table'[Category]),1,0),1)

 

ValtteriN_3-1705431284684.png

 

Now the previously shown row is not shown since the row had category = A.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/









Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.