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
JoanElGran1899
Frequent Visitor

How to use Count with some filters?

Hi Everyone!

It's my first post, but I expect it will not be the last one.

 

My problem is that i want to count the orders which have the next filters, but if the order have the three variables, I only want to count like one order.

 

I wrote something like this, but was wrong.

 

JoanElGran1899_0-1620982797533.png

 

Thank you in advance!

 

1 ACCEPTED SOLUTION

@JoanElGran1899 , You can add any number like

Calculate( [Measure], filter(Table, Table[A1] ="A" || Table[A2] ="B" || Table[A3] ="C"))

 

another example

 

Calculate( [Measure], filter(Table, (Table[A1] ="A" || Table[A2] ="B" || Table[A3] ="C") &&  Table[D1] ="D"))

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@JoanElGran1899 , In this one you should remove if , filter with OR(||) seems fine.

 

If this does not work

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@amitchandak Thank you for answer,

I tried OR before but it only accept two conditions, and I have three conditions.

 

@JoanElGran1899 , You can add any number like

Calculate( [Measure], filter(Table, Table[A1] ="A" || Table[A2] ="B" || Table[A3] ="C"))

 

another example

 

Calculate( [Measure], filter(Table, (Table[A1] ="A" || Table[A2] ="B" || Table[A3] ="C") &&  Table[D1] ="D"))

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.