Forum Discussion
DAX help
- 8 years ago
Hi,
How about this
=CALCULATE(DISTINCTCOUNT(Terms[Employee Number]),SAMEPERIODLASTYEAR('Date Dim'[Date]))- mikeborg828 years agoAdvocate II
Oddly, this did not work. I get the same results with this calc (all of prior year), not just YTD last year at this time..
- mikeborg828 years agoAdvocate II
Here is what happens. Last years terms should only be 545, and at this point last year should only be about 380.. But when i put into the table, it brings all terms. I think year is out of context, or something. just not sure how to fix. Appreciate any help. Thanks!
- mikeborg828 years agoAdvocate II
PY Test = CALCULATE(DISTINCTCOUNT(Terms[Employee Number]),SAMEPERIODLASTYEAR(Terms[Actual Termination Date]))
It seems to work like this... when i refer to the date dimension table it doesnt seem to work, but this way it does. Does that seem right? could there be a reason that this is happening and maybe something i should fix upstream? Thanks, still getting my feet wet with DAX and powerbi.
- mikeborg828 years agoAdvocate II
sorry to keep this going - but now I run into the following error message when trying to pull in other fields into the visual.
but when i refer to the date table, i do not get the right values. but that causes other issues like this since not referring to date table. i must be doing something wrong, but can't seem to figure it out.