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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors