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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

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
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

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
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.