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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
trevordunham
Resolver I
Resolver I

Filtering out Results older than X date

I am working with data broken down by a state field. There are some results coming through from specific states that should not before a certain date. I need to filter out all data coming through for the state of WI whenever the date was before 9/19/2022. I tried to do a simple IF statement such as this:

 

Filter = IF([State]='WI' AND [Date]<DATE(2022,9,19),1,0) 

 

The measure is full of errors: cannot find either of my fields, AND is not a correct

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @trevordunham ,

 

I think you should use "&&" between conditions or use AND(MAX([State])='WI',MAX([Date])<DATE(2022,9,19)).

Filter =
IF ( MAX([State]) = 'WI' && MAX([Date]) < DATE ( 2022, 9, 19 ), 1, 0 )

Then add this measure into visual level filter and set it to show items when value =1.

RicoZhou_0-1663743484885.png

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
amitchandak
Super User
Super User

@trevordunham , A measure would be like

 

Countrows(Filter(Table, [State]="WI" && [Date]<DATE(2022,9,19) ))

 

or

 

calculate(sum(Table[Value]),  Filter(Table, [State]="WI" && [Date]<DATE(2022,9,19) ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thanks for the help! I was able to get the first measure to work. I just wanted to make sure I am using it as a filter correctly, how would I filter on it, less than 1? When I try that it seems to remove rows where we see WI results with date 9/19/2022 incorrectly.

Anonymous
Not applicable

Hi @trevordunham ,

 

I think you should use "&&" between conditions or use AND(MAX([State])='WI',MAX([Date])<DATE(2022,9,19)).

Filter =
IF ( MAX([State]) = 'WI' && MAX([Date]) < DATE ( 2022, 9, 19 ), 1, 0 )

Then add this measure into visual level filter and set it to show items when value =1.

RicoZhou_0-1663743484885.png

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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