cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
asniyaz93 Frequent Visitor
Frequent Visitor

Count based on multiple criteria

Hello,

I am a newbie integrating Power BI at my workplace. Could you please help with a query to sum/count based on multiple criteria.

 

I have a data set of each customer and  Sales rep assigned to that customer and number of sales units sold to each customer. 

 

I want a column that has Count of sales units >=1  sold  - rolled up by each sales Rep -  though the data set has rows for each customer.  Table should be as shown below. Please see example below.

IE - JEFF has 2 customers where units sold >=1 

 

Sales Rep - Customer - Units Sold - Count of Sales units >1 (ALL Customers of that sales rep)

JEFF       -     ABC                    3          -     2

Dave     -       XYZ                1          -    1

JEFF     -        BNM                 7          -   2

 

 

Thanks for your help!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: Count based on multiple criteria

Hi @asniyaz93,

 

Please create a calculated column with below formula:

Count of Sales Unit =
CALCULATE (
    DISTINCTCOUNT ( Table[Customer] ),
    FILTER ( ALLEXCEPT ( Table, Table[Sales Rep] ), Table[Units Sold] >= 1 )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
v-yulgu-msft Super Contributor
Super Contributor

Re: Count based on multiple criteria

Hi @asniyaz93,

 

Please create a calculated column with below formula:

Count of Sales Unit =
CALCULATE (
    DISTINCTCOUNT ( Table[Customer] ),
    FILTER ( ALLEXCEPT ( Table, Table[Sales Rep] ), Table[Units Sold] >= 1 )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 262 members 2,437 guests
Please welcome our newest community members: