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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
Austen229022
Helper I
Helper I

Power Query Literal Token Expected

I am trying to set up a simple IF AND statement to check within ranges to the provide a range category, though I am having an issue with a Literal Token Expected error on something that shouldnt be an error.

Provided is an image below to show exactly where the issue is

Austen229022_0-1707094884968.png

 



Can anyone help with this?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Austen229022 , Problem in row Two and 3

You are using  [Column] >2 and <= 5

 

You need to use

[Column] >2 and [Column] <=5

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Ahmedx
Super User
Super User

pls try this

 = if [Assessment to Decision] <= 2 then "0 - 2 Working Days" 
else if [Assessment to Decision] <= 5 then "3-5 Working Days" 
else if [Assessment to Decision] <= 15 then "5 - 15 Working Days" 
else "15+ Working Days"
Ritaf1983
Super User
Super User

Hi @Austen229022 
When you writing and/ or statements in PQ
You need to repeat a column name: 
if a>5 and a<9...

not
if a>5 and <9

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
amitchandak
Super User
Super User

@Austen229022 , Problem in row Two and 3

You are using  [Column] >2 and <= 5

 

You need to use

[Column] >2 and [Column] <=5

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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