- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Token then expected error
I am experiencing a token then expected error for the following code with the first AND underlined in red:
if [rev] <1 then "Stopped"
else if [rev] >= 1 AND [rev] <= 100000 then "Below $100K"
else if [rev] > 100000 AND [rev] <= 500000 then "Between $100K and $500K"
else if [rev] > 500000 AND [rev] <= 1000000 then "Between $500K and $1M"
else if [rev] > 1000000 AND [rev] <= 5000000 then "Between $1M and $5M"
else "More than $5M"
how can i get rid of this error?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @cel ,
Try writing all the "AND"s in lowercase as "and".
M language is entirely case-sensitive, so this is probably the issue.
Pete
Now accepting Kudos! If my post helped you, why not give it a thumbs-up?
Proud to be a Datanaut!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @cel ,
Try writing all the "AND"s in lowercase as "and".
M language is entirely case-sensitive, so this is probably the issue.
Pete
Now accepting Kudos! If my post helped you, why not give it a thumbs-up?
Proud to be a Datanaut!

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

User | Count |
---|---|
28 | |
26 | |
22 | |
13 | |
10 |
User | Count |
---|---|
24 | |
22 | |
17 | |
11 | |
9 |