Forum Discussion
Custom Financial Year
- 7 years ago
you can specify custom financial year in the calculation
https://docs.microsoft.com/en-us/dax/datesytd-function-dax
you will need custom column in your calendar tableFinancialYear = VAR __month = MONTH('Calendar'[Date]) VAR __year = YEAR('Calendar'[Date]) RETURN IF(__month<6, __year-1 & "/" &__year, __year & "/" & __year+1)SAMEPERIODLASTYEAR will work fine whenever you select year from this
as for YTD, you can use DATESYTD, e.g.
YTD = CALCULATE( SUM('public nomhead'[nominal]), DATESYTD(Calendar[Date], "31-05") )for PY YTD you can just use SAMEPERIODLASTYEAR within calculate that uses the [YTD] measure
I set the direction in the relatio bship betwen the calendar and fact table as one way as per other forum post and it seems to work.
Strange... would be useful to know why
I always try to keep them with single direction as it makes DAX more predictable, here is some explanation on bidirectional relationships in general
https://www.sqlbi.com/articles/bidirectional-relationships-and-ambiguity-in-dax/