Forum Discussion
Anonymous
7 years agoNot applicable
creating date/calendar table
Hi all, need some advice here, i am trying to follow the steps here https://www.powerobjects.com/blog/2018/12/19/sorting-data-fiscal-year-power-bi/ but got this error: The following syntax error ...
- 7 years ago
Hi Anonymous ,
You may need to change the syntax "– 1" to "-1" in your formula in English input format, then it will work well.
FYMonthNum =
VAR FYStartMonth = 4
//Update the fiscal year starting month above *Use number between 1 to 12
RETURN IF ( MONTH ( 'Date'[Date]) >= FYStartMonth,
MONTH ( 'Date'[Date] )- ( FYStartMonth -1 ),
12 + (MONTH ( 'Date'[Date] ) - (FYStartMonth -1 ) ) )Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
7 years agoNot applicable
parry2k changed the double quotes and it worked!
how abt step 2? I got error as well
parry2k
Super User
7 years agoAnonymous can you share what expression are you using? I have no idea what is step 2.
- Anonymous7 years agoNot applicable
I copied this code
FYMonthNum = VAR FYStartMonth = 4 //Update the fiscal year starting month above *Use number between 1 to 12 RETURN IF ( MONTH ( 'Date'[Date]) >= FYStartMonth, MONTH ( Date[Date] ) – ( FYStartMonth – 1 ), 12 + ( MONTH ( Date[Date] ) – ( FYStartMonth – 1 ) ) )- parry2k7 years ago
Super User
Anonymous you are missing single quote
FYMonthNum = VAR FYStartMonth = 4 //Update the fiscal year starting month above *Use number between 1 to 12 RETURN IF ( MONTH ( 'Date'[Date]) >= FYStartMonth, MONTH ( 'Date'[Date] ) - ( FYStartMonth – 1 ), 12 + ( MONTH ( 'Date'[Date] ) – ( FYStartMonth – 1 ) ) )- Anonymous7 years agoNot applicable