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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Auto Filter Based on Slicer Date

I have a slicer that is limiting a data set to the most recent "as of date" the table has the below structure. I need to further limit the output in my visuals to display only totals with an OpenDate month that is the month of the AsOfDate.

For example, using the below table I want to get the SUM of Amount where AsOfDate is 3/30/2022 and the OpenDate month is 3/2022.

 

Tables are using direct query.

 

AsOfDate  OpenDate  Amount
3/30/2022  3/01/2022  50.00
3/30/2022  3/4/2022  75.00
3/30/2022  1/10/2022  100.00
3/29/2022  1/12/2022  200.00

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Anonymous,

You can add a measure to extract the current slicer selection and compare it with the 'open date' field values to return flag, then you can use this measure on the 'visual level filter' to filter records based on the flag.

Applying a measure filter in Power BI - SQLBI

flag =
VAR currSelected =
    MAX ( Table[AsOfDate] )
VAR currOpenDate =
    MAX ( Table[OpenDate] )
RETURN
    IF ( currOpenDate <= currSelected, "Y", "N" )

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @Anonymous,

You can add a measure to extract the current slicer selection and compare it with the 'open date' field values to return flag, then you can use this measure on the 'visual level filter' to filter records based on the flag.

Applying a measure filter in Power BI - SQLBI

flag =
VAR currSelected =
    MAX ( Table[AsOfDate] )
VAR currOpenDate =
    MAX ( Table[OpenDate] )
RETURN
    IF ( currOpenDate <= currSelected, "Y", "N" )

Regards,

Xiaoxin Sheng

danextian
Super User
Super User

Hi @Anonymous ,

Have you tried using another date slicer, this time, for OpenDate?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

I did, it works but I would ideally like to default the slicer selection to the month of the 'AsOfDate' if that makes sense?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors