Forum Discussion
Anonymous
4 years agoNot applicable
DAX
Hi, I want to calculate a count of values in a column from the date of whatever the start date in my table till my filter selection (year & month )-1 For example, If I have data from Jan 2021 and M...
- 4 years ago
Hi Anonymous
>> in the slicer im using only Year and Month value.
You can try this, create the measure below
count = var _EndDate=DATE(SELECTEDVALUE('calendar'[year]),SELECTEDVALUE('calendar'[month]),1) return CALCULATE( COUNTROWS(FactTable),FILTER(ALL(FactTable),FactTable[Date]<_EndDate))calendar table
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
v-xiaotang
4 years agoCommunity Support
Hi Anonymous
>> in the slicer im using only Year and Month value.
You can try this, create the measure below
count =
var _EndDate=DATE(SELECTEDVALUE('calendar'[year]),SELECTEDVALUE('calendar'[month]),1)
return
CALCULATE( COUNTROWS(FactTable),FILTER(ALL(FactTable),FactTable[Date]<_EndDate))
calendar table
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Thank you, It worked!!