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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Baarathi88
Helper III
Helper III

Restrict based on summation

Is there a way to Count Distinct Order with Sales above 300.

 

I tried this expression but getting wrong result. 

Order Count = CALCULATE(DISTINCTCOUNT(Sheet1[OrderID]),FILTER(Sheet1,Sum(Sheet1[Sales])>300))
 
No. of Orders with sales over 300 is 2. But I'm getting the result as 4 using the above expression.

 

 

 

OrderIDOrderDateShippedDateDelivery DateSales
113/1/202015/02/202013/03/2020100
215/02/202013/03/202015/04/202050
215/02/202013/04/202015/05/2020300
315/02/202013/03/202015/04/2020250
315/02/202013/04/202015/05/202060
415/02/202013/03/202015/04/202030
415/02/202013/04/202015/05/202080
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Baarathi88 

It's all about context.  Give this a try:

Order Count = 
CALCULATE(
    DISTINCTCOUNT( Sheet1[OrderID] ),
    FILTER ( 
        VALUES(Sheet1[OrderID]),
        CALCULATE( SUM ( Sheet1[Sales] ) > 300 )
    )
)

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Baarathi88 

It's all about context.  Give this a try:

Order Count = 
CALCULATE(
    DISTINCTCOUNT( Sheet1[OrderID] ),
    FILTER ( 
        VALUES(Sheet1[OrderID]),
        CALCULATE( SUM ( Sheet1[Sales] ) > 300 )
    )
)

@jdbuchanan71 Thank you, that works

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors