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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Better way to structure multiple IF statements?

Hello - I have the following requirements to group items into a single "Comments" column:

a) Status Column: Under Review
Testing Status: all items in this column
Status Column: Open
Testing Status: In First Review, In Second Review

 

The goal is to group these into the "Comments" column.
I created the if statements below, but it only returns 3 items. There are a total of 11 items returned when I apply these filters in the excel table. 

Is there a better way to structure this? or what am i doing wrong where I only get 3 items? Any help is greatly appreciated!

 

 

 

if [Status]=  "Under Review" and [Testing Status] = "In Progress"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = "In Review"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = "In Review #2"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = "Not Started"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = "Not Yet Tested"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = "Not Yet Tested 2"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = "Pending Evidence"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = "Tested by Team"

then "Comments"

else if [Status]=  "Under Review" and [Testing Status] = ""

then "Comments"

else if [Status]=  "Open" and [Testing Status] = "In First Review"

then "Comments"

else if [Status]=  "Open" and [Testing Status] = "In Second Review"

then "Comments"

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may change the power query codes like below in Query Editor.

 

=if [Status]=  "Under Review" and

([Testing Status] = "In Progress"      

or [Testing Status] = "In Review"

or [Testing Status] = "In Review #2"

or [Testing Status] = "Not Started"

or [Testing Status] = "Not Yet Tested"

or [Testing Status] = "Not Yet Tested 2"

or [Testing Status] = "Pending Evidence"

or [Testing Status] = "Tested by Team"

or [Testing Status] = "" )

then "Comments"

else

  if [Status]=  "Open" and ([Testing Status] = "In First Review" or [Testing Status] = "In Second Review" )

  then "Comments"

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may change the power query codes like below in Query Editor.

 

=if [Status]=  "Under Review" and

([Testing Status] = "In Progress"      

or [Testing Status] = "In Review"

or [Testing Status] = "In Review #2"

or [Testing Status] = "Not Started"

or [Testing Status] = "Not Yet Tested"

or [Testing Status] = "Not Yet Tested 2"

or [Testing Status] = "Pending Evidence"

or [Testing Status] = "Tested by Team"

or [Testing Status] = "" )

then "Comments"

else

  if [Status]=  "Open" and ([Testing Status] = "In First Review" or [Testing Status] = "In Second Review" )

  then "Comments"

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

Measure =
SWITCH (
TRUE (),
[Status] = "Under Review"
&& ( [Testing Status] = "In Progress"
|| [Testing Status] = "In Review"
|| [Testing Status] = "In Review #2"
|| [Testing Status] = "Not Started"
|| [Testing Status] = "Not Yet Tested"
|| [Testing Status] = "Not Yet Tested 2"
|| [Testing Status] = "Pending Evidence"
|| [Testing Status] = "Tested by Team"
|| [Testing Status] = "" ), "Comments",
[Status] = "Open"
&& ( [Testing Status] = "In First Review"
|| [Testing Status] = "In Second Review" ), "Comments"
)

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.