Forum Discussion
mikeborg82
8 years agoAdvocate II
DAX help
PY YTD Terms = CALCULATE(DISTINCTCOUNT(Terms[Employee Number]),FILTER(SAMEPERIODLASTYEAR('Date Dim'[Date]),CONTAINS(VALUES('Date Dim'[Prior Year]), 'Date Dim'[Prior Year], 'Date Dim'[Date]))) I h...
- 8 years ago
Ashish_Mathur
8 years agoSuper User
You are welcome. The DATESBETWEEN() function used in the YTD terminations measure ensures that the arithmatic (distinctcount in our case) starts from the 1st day of the year and goes till the last date of the month chosen in the visual filter.
mikeborg82
8 years agoAdvocate II
Yes, this makes perfect sense. I assumed when I used a function like "TotaLYTD", that powerbi would know to give me the total of the year I am in YTD at the time, and I wouldn't need to add a filter. My date dimension table goes for several years ahead, so this could be why when I use the totalytd function with no filter, I get blank results.
Thanks again for your help.