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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jakeryan56
Advocate II
Advocate II

Count based on multiple conditions

Hi, I have a requirement that I am having trouble wrapping my mind around even though it is probably simple. 

 

I have a table called SalesData. It contains various attributes about a sale and below is a simplified example of the data.

Capture.PNG

 

 

We would like to create the following measures based on this data and then filter this to a SalesRep level. 

-Invoices with 1 item sold

-Invoices with 2 items sold

-Invoices with 3 items sold

-Invoieces with 4+ items sold

 

So just to be clear, this isn't the average (i.e. Total products/Total unique invoices created)  - this needs to be a count of the number of instances the above conditions are met.

 

Any ideas?

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @jakeryan56,

 

Have you solved your probelm?

 

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please share your desired output so that we could help further on it.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measure

 

Invoices with 1 item sold = COUNTROWS(FILTER(SUMMARIZE(VALUES(Sales_Data[Invoice]),[Invoice],"ABCD",COUNTA(Sales_Data[Description])),[ABCD]=1))

 

Just change the filter condition to 2,3 etc. for computing other measures.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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