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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GJ217
Resolver III
Resolver III

Age Banding Token Eof expected Error in Power Query

Hi,

 

Can someone please look over my IF statment below which is bringing back this error message Token Eof expected  with the error showing on the first row.

 

=IF[Age] <= 20 THEN "Upto 20yrs"
ELSE IF [Age] >= 21 AND [Age] <= 30 THEN "21-30yrs"
ELSE IF [Age] >= 31 AND [Age] <= 40 THEN "31-40yrs"
ELSE IF [Age] >= 41 AND [Age] <= 50 THEN "41-50yrs"
ELSE "Over 50yrs"

 

Many Thanks

1 ACCEPTED SOLUTION
GJ217
Resolver III
Resolver III

Hi All,

 

solved it myself as below.

 

if[Age] <= 20 then "Upto 20yrs"
else if [Age] >= 21 and [Age] <= 30 then "21-30yrs"
else if [Age] >= 31 and [Age] <= 40 then "31-40yrs"
else if [Age] >= 41 and [Age] <= 50 then "41-50yrs"
else "Over 50yrs"

View solution in original post

3 REPLIES 3
GJ217
Resolver III
Resolver III

Hi All,

 

solved it myself as below.

 

if[Age] <= 20 then "Upto 20yrs"
else if [Age] >= 21 and [Age] <= 30 then "21-30yrs"
else if [Age] >= 31 and [Age] <= 40 then "31-40yrs"
else if [Age] >= 41 and [Age] <= 50 then "41-50yrs"
else "Over 50yrs"

serpiva64
Super User
Super User

Hi,

Try this one

=  if [Age] <= 20 then "Upto 20yrs"
else if [Age] <= 30 then "21-30yrs"
else if [Age] <= 40 then "31-40yrs"
else if [Age] <= 50 then "41-50yrs"
else "Over 50yrs"

 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

Thanks @serpiva64  but I managed to solve it in the end.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.