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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors