Forum Discussion
DAX help
- 8 years ago
Hi,
How about this
=CALCULATE(DISTINCTCOUNT(Terms[Employee Number]),SAMEPERIODLASTYEAR('Date Dim'[Date]))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.
- Ashish_Mathur8 years agoSuper User
Hi,
You have to create a relationship from the Actual Termination data column of the Terms Table with the Date column of the calendar table. If you need more specific help, share the link from where i can download your file.
- mikeborg828 years agoAdvocate II
Thanks. sent you message with the link. it is just a sample test file. thanks again for any help!