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
jakeryan56
Helper III
Helper III

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
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.