Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
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 occurred during parsing: Invalid token, Line 3, Offset 10, “.
Can anyone advice
Solved! Go to Solution.
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.
Hi @Anonymous ,
Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best regards
Amy
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 I copied the code and it worked, I need to fix the double quotes. Can you copy DAX expression what you are using?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k changed the double quotes and it worked!
how abt step 2? I got error as well
@Anonymous can you share what expression are you using? I have no idea what is step 2.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 )
)
)
@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 )
)
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
there is special character
fixed with this
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 )
)
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous
I would recommend manually type the code, it works for me and I don't see any reason why it shouldn't work for you.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 48 | |
| 35 | |
| 31 | |
| 27 |