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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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 carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.