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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Werfuks
Frequent Visitor

Token then expected

Hi all, 

I'm getting a bit confused with this IF formula:  

 

if [Completion Date] < [#"Month/Year"] and [Status] = Requested and [Status] = In Progress and [Status] = Approved by Management then "Overdue" else ""

 

The system highlight the word Progress with "Token then expected"

Does that mean that the If Formula can handle only one "and" expression?

 

Thank you

Christian

2 ACCEPTED SOLUTIONS
AlB
Super User
Super User

Hi @Werfuks 

if can handle whatever you throw at it.

What are Requested and In Progress ? Variables? If it's just text, which is what it looks like, you'd have to use 

"Requested" and "In Progress". Same for Approved

if [Completion Date] < [#"Month/Year"] and [Status] = "Requested" and [Status] = "In Progress" and [Status] = "Approved" by Management then "Overdue" else ""

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

watkinnc
Super User
Super User

You have to enclose the text values in double  quotes, like [Satus] = "Requested" and ...

Bur are you sure that "and" is appropriate? How is [Status] going to = "Requested" AND "In Progress" AND "Approved by Management"? The if statement evaluates to true or false per row, so the [Status] will be just one thing, not one thing AND another thing.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

3 REPLIES 3
Werfuks
Frequent Visitor

Many thanks to you guys. With the double quotes it works now!

watkinnc
Super User
Super User

You have to enclose the text values in double  quotes, like [Satus] = "Requested" and ...

Bur are you sure that "and" is appropriate? How is [Status] going to = "Requested" AND "In Progress" AND "Approved by Management"? The if statement evaluates to true or false per row, so the [Status] will be just one thing, not one thing AND another thing.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
AlB
Super User
Super User

Hi @Werfuks 

if can handle whatever you throw at it.

What are Requested and In Progress ? Variables? If it's just text, which is what it looks like, you'd have to use 

"Requested" and "In Progress". Same for Approved

if [Completion Date] < [#"Month/Year"] and [Status] = "Requested" and [Status] = "In Progress" and [Status] = "Approved" by Management then "Overdue" else ""

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors