Forum Discussion
Dax USERELATIONSHIP not working
- 3 years ago
powerbignc , for Time intelligence better to use date table and TI functions
example
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
I had to use:
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Here is the probem, I have another table that filters my Date table and when that table filters the Date table the "SAMEPERIODLASTYEAR" formula does not work... For some reason though it does work with the dateadd('Date'[Date],-1,Year).
So if you have a filter table filtering the Date table use dateadd NOT SAMEPERIODLASTYEAR