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
Anonymous
Not applicable

Stuck with more than 2 arguements with OR & AND

Hi All,

 

SOS, need an urgent help over the countrows formula.

 

Situation:

I have a operation statuses where consist of "New", "Pending", "In Progress", "Assigned", "Resolved" and "Closed"

End of day, I need to show the summary of WIP volume, consists of "New", "Pending", "In Progress", "Assigned" statues. I managed to do with 2 arguements, with sample formula:-

 

Total Resolved & Closed Volume = COUNTROWS(FILTER('KPI',OR('KPI'[Status]="Closed",'KPI'[Status]="Resolved")))

 

However, failed to do the magic for 4 statues mentioned above. I tried browsing through the other threads, and understand I should do nesting, but very new to PowerBI, and hoping some of you can provide some guidance on how nesting works.

 

Thank you in advance.

Bobby

 

1 ACCEPTED SOLUTION

There are a few options
 
1. worst is to nest the or statements.  Or(x,or(y,z))
2. use inline syntax. X || Y || Z (|| is a double pipe which is above the enter key (shift backslash)).  Use && for and
 
I think this will work too
 
calculate(countrows(table),column=x || column=y || column=z)
  
Also with And, you can use this syntax
calculate(countrows(table),column=x,column =y,column=z)


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

2 REPLIES 2

There are a few options
 
1. worst is to nest the or statements.  Or(x,or(y,z))
2. use inline syntax. X || Y || Z (|| is a double pipe which is above the enter key (shift backslash)).  Use && for and
 
I think this will work too
 
calculate(countrows(table),column=x || column=y || column=z)
  
Also with And, you can use this syntax
calculate(countrows(table),column=x,column =y,column=z)


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

thank you. || works!!

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.