Forum Discussion
imranami
6 years agoHelper I
SAMEPERIODLASTYEAR for Fiscal year
Hello. I have a Date table with a one to many join to a date field in a sales table. The Date table has a column which identifies the correct financial year for each date (FY18, FY19, FY20). The fina...
- 6 years ago
Looks the guidance provided in this article has resolved the issue using the below article (Russo & Ferrari).
https://www.daxpatterns.com/time-patterns/
Added an additional date column to my table which subtracts the current date by one year:
PY Date = DATE(YEAR(Dates[Date])-1,MONTH(Dates[Date]),DAY(Dates[Date]))
Then used the following DAX to return the sales amount from the previous year:Total Value Previous Year =CALCULATE ([Total Sales],FILTER (ALL ( Dates ),Dates[Year] = MAX ( Dates[Year])-1&& Dates[Date] <= MAX ( Dates[PY Date] )))
imranami
6 years agoHelper I
Looks the guidance provided in this article has resolved the issue using the below article (Russo & Ferrari).
https://www.daxpatterns.com/time-patterns/
Added an additional date column to my table which subtracts the current date by one year:
PY Date = DATE(YEAR(Dates[Date])-1,MONTH(Dates[Date]),DAY(Dates[Date]))
Then used the following DAX to return the sales amount from the previous year:
Then used the following DAX to return the sales amount from the previous year:
Total Value Previous Year =
CALCULATE (
[Total Sales],
FILTER (
ALL ( Dates ),
Dates[Year] = MAX ( Dates[Year])-1
&& Dates[Date] <= MAX ( Dates[PY Date] )
))
- johnny43 years agoFrequent Visitor
Great solution, thank you!