Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BAFreedom
Helper I
Helper I

Power Query - Token Comma Expected

In Power Query,

 

I am trying to use Power Query to general a Fiscal Year. 

Eg. If April 1, 2022, then Fiscal Year is FY22/23

 

Here is my Custom Column Formula:

if [Month] ❤️ then "FY" &
Text.End(Number.ToText([Year]),2) & "/" &
Text.End(Number.ToText([Year],2) else
"FY" &
Text.End(Number.ToText([Year]),2) & "/" &
Text.End(Number.ToText([Year}+1,2)

 

BAFreedom_0-1671951707227.png

 

Result: Token Comma expected. When I click Show Error, it highlights "else."

How do I fix this?

Thanks.

1 ACCEPTED SOLUTION
Migasuke
Memorable Member
Memorable Member

Hi @BAFreedom ,

I think you have few typos there. There is bracket missing + one bracket ) is }.
Check my code:

if [Month] ❤️ then "FY" &
Text.End(Number.ToText([Year]),2) & "/" &
Text.End(Number.ToText([Year],2)) else
"FY" &
Text.End(Number.ToText([Year]),2) & "/" &
Text.End(Number.ToText([Year]+1,2))

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

2 REPLIES 2
Migasuke
Memorable Member
Memorable Member

Hi @BAFreedom ,

I think you have few typos there. There is bracket missing + one bracket ) is }.
Check my code:

if [Month] ❤️ then "FY" &
Text.End(Number.ToText([Year]),2) & "/" &
Text.End(Number.ToText([Year],2)) else
"FY" &
Text.End(Number.ToText([Year]),2) & "/" &
Text.End(Number.ToText([Year]+1,2))

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Thank you

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.