Forum Discussion
Getting help with this complicated DAX question
- 2 years ago
The LASTDATE filter will adjust the filter context to only return a single date. COUNTROWS then calculates the employee count for that date (month).
fyi when i did this just to test it out... why is it like this?
Hey YoungLearning ,
as AlexisOlson mentioned LASTDATE returns the last date of the filter context. The date hierarchy present in the table view is "contributing" to the filter context of the cell that shows the result of your LASTDATE measure. Each cell has a different filter context, for this reason the measure returns a different value in each cell. If you remove the day column from the table you will see that LASTDATE will return the last date of the month.
Regards,
Tom
- YoungLearning2 years agoHelper III
Yes, seems like it. But back to the original question now. Why not the Headcount[date] column, why Date[date]? This columns have a relationship.
- YoungLearning2 years agoHelper III
It wants to count the number of employees, year, month and quarter basis. COUNTROWS definitely double count if I do it by year or quarter.
- YoungLearning2 years agoHelper III
example data