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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.