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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.