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
Anonymous
Not applicable

Replace slicer Filter with FILTER() in DAX

Hey guys,

 

I am counting status updates for projects based on Status Dates with Filter on the side (slicer), with this measure :

IvyM_0-1638893894263.png

 

For some reasons i would like to not use the slicer, but use the FILTER() function, while putting fixed dates (I am aware it's a downgrade).

I want to add this :

FILTER('SNOW - Complete Status Report', 'SNOW - Complete Status Report'[Status Date]> "15/11/2021" && 'SNOW - Complete Status Report'[Status Date]< "03/12/2021"

on the line where I do COUNT(), but COUNT() takes only a column into account, can't do other functions I think ?

 

I want to say: count me the status updates for projects in this table, while having these dates range in mind.

 

I am really struggling with this thing, hopefully someone will enlighten me !

Thanks in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Not very clear. A measure like

 

countrows(FILTER('SNOW - Complete Status Report', 'SNOW - Complete Status Report'[Status Date]> date(2021,11,15)  && 'SNOW - Complete Status Report'[Status Date]< date(2021,12,03) ))

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amitchandak 
Thank you very much for the inspiration ! 🙂
By using
countrows(FILTER('SNOW - Complete Status Report', 'SNOW - Complete Status Report'[Status Date]> date(2021,11,15)  && 'SNOW - Complete Status Report'[Status Date]< date(2021,12,03) ))
I saw that COUNTROWS() accepts only a table, thus it didn't recognize my column Status Date.

Finally, I found KEEPFILTERS() and combine it with COUNTROWS() in my measure.
* well I had to adapt it because KEEPFILTERS() accepts 1 filter at a time, but I chose only one date, not an interval. For my case it's acceptable

 

But you synthax for date worked very well !
This works for me (maybe it can help others) :

IvyM_0-1638961993539.png

 


amitchandak
Super User
Super User

@Anonymous , Not very clear. A measure like

 

countrows(FILTER('SNOW - Complete Status Report', 'SNOW - Complete Status Report'[Status Date]> date(2021,11,15)  && 'SNOW - Complete Status Report'[Status Date]< date(2021,12,03) ))

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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