SQL_M
SQL_M

Reputation: 2475

PowerBI Fiscal YEAR

I want to create a measure in PowerBI for fiscal year. I am starting with PowerBI, so my experience is very limited.

This gives a syntax error:

FiscalYear_ = IF(MONTH(NOW()) <= 9, YEAR(NOW()); YEAR(NOW()) + 1) 

What am I doing wrong here?

Thanks a lot for your help!

KR M

Upvotes: 0

Views: 96

Answers (1)

Andrey Nikolov
Andrey Nikolov

Reputation: 13450

Because in some locales comma is used as decimal separator, parameters separator in functions sometimes is not comma (,), but semicolon (;). This depends on your regional settings. But in your example, you mixed both separator types - there is a comma after 9 and semicolon after "value if true" parameter. You should fix the wrong one and the measure to be either:

FiscalYear_ = IF(MONTH(NOW()) <= 9, YEAR(NOW()), YEAR(NOW()) + 1) 

or

FiscalYear_ = IF(MONTH(NOW()) <= 9; YEAR(NOW()); YEAR(NOW()) + 1) 

Upvotes: 1

Related Questions