Forum Discussion

bilalkhokar73's avatar
bilalkhokar73
Helper IV
4 years ago
Solved

Countx With date filter

I have written one DAX , this dax will give me ,

this will return count of weekends in selected month, IsWeekend is my column with true and false value in that , this is giving me right result but when i select feb in slicer , now i want to remove slicer 
countx(FILTER(tm_date,tm_date[IsWeekend]=TRUE()),tm_date[Date])

I want that what ever currenth month will be it shoudl give me that month count , i tried to use calculate but syntax issue 
I am restricting count on current month basis , how to do that 

 

  • bilalkhokar73 , Try for today's  month

     

    countx(FILTER(tm_date,tm_date[IsWeekend]=TRUE() && eomonth(tm_date[Date],0) = eomonth(today(),0)),tm_date[Date])

     

    use maxx(allselected(tm_date), tm_date[Date])  for selected date, in place of today

2 Replies

  • bilalkhokar73 , Try for today's  month

     

    countx(FILTER(tm_date,tm_date[IsWeekend]=TRUE() && eomonth(tm_date[Date],0) = eomonth(today(),0)),tm_date[Date])

     

    use maxx(allselected(tm_date), tm_date[Date])  for selected date, in place of today