The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
User | Count |
---|---|
20 | |
8 | |
7 | |
7 | |
6 |
User | Count |
---|---|
29 | |
12 | |
11 | |
9 | |
8 |