Forum Discussion
MVenables
Advocate II
2 years agoEfficient Prior Year DAX Calculation needed please
Hi All, Within the business our Financial Year starts 1st May each year so for example this current week is Year Week 202401 (the year & the week number). To calculate anything for prior year, we...
aduguid
Memorable Member
2 years ago
Count Of Products Prior Year =
VAR _fiscal_year = YEAR(EDATE( _today_date, 5))
VAR _fiscal_year_start = DATE ( _fiscal_year - 1, 05, 01)
VAR _fiscal_year_end = DATE ( _fiscal_year, 04, 30)
RETURN
CALCULATE(
[Count Of Products],
DATESBETWEEN('Calendar'[Date], _fiscal_year_start, _fiscal_year_end)
)