Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
FiscalMonthStartDate =
VAR CalendarYear = YEAR('Calendar'[Date])
VAR FiscalYearStartMonth = 8
RETURN
IF(
MONTH('Calendar'[Date]) >= FiscalYearStartMonth,
DATE(CalendarYear, MONTH('Calendar'[Date]) - 7, 1),
DATE(CalendarYear - 1, MONTH('Calendar'[Date]) + (12 - FiscalYearStartMonth + 1), 1)
)
Hi,
I am trying to write a formula like that but I get a eof token expected warning. How can I solve that? Thank you.
Solved! Go to Solution.
Hi @Anonymous ,
If you create a calculated column, this dax outputs as expected.
If you create a measure, modify the dax as follows:
Measure_FiscalMonthStartDate =
VAR CalendarYear = YEAR(MAX('Calendar'[Date]))
VAR FiscalYearStartMonth = 8
RETURN
IF(
MONTH(MAX('Calendar'[Date])) >= FiscalYearStartMonth,
DATE(CalendarYear, MONTH(MAX('Calendar'[Date])) - 7, 1),
DATE(CalendarYear - 1, MONTH(MAX('Calendar'[Date])) + (12 - FiscalYearStartMonth + 1), 1)
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
If you create a calculated column, this dax outputs as expected.
If you create a measure, modify the dax as follows:
Measure_FiscalMonthStartDate =
VAR CalendarYear = YEAR(MAX('Calendar'[Date]))
VAR FiscalYearStartMonth = 8
RETURN
IF(
MONTH(MAX('Calendar'[Date])) >= FiscalYearStartMonth,
DATE(CalendarYear, MONTH(MAX('Calendar'[Date])) - 7, 1),
DATE(CalendarYear - 1, MONTH(MAX('Calendar'[Date])) + (12 - FiscalYearStartMonth + 1), 1)
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |