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 August 31st. Request your voucher.

Reply
tomekp0
New Member

DISTINCTCOUNT with sum filter

I have simple sales data, each row is equal to one SKU sold, sample: 

 

DateClientSKUPriceSeller
01.09.2022    AAA                Item1         99               Seller1        
01.09.2022AAAItem2109Seller1
02.09.2022BBBItem199Seller2

 

How to count clinents that orderder above certaint treshold (for example 5000) in each time perion?

Ive alcready done filtering by sellers and by dates, but i have problem with DISTINCTCOUNT funcion.

 

My atteptes: 

1) 

Clients1 = CALCULATE(DISTINCTCOUNT('sales'[Client]), 'sales'[Price] > 5000)
 
2)
Created new measure: 
sum_sales = sum(sales[Price])
And: 
Clients2 = CALCULATE(
DISTINCTCOUNT(sales[Client]),
FILTER('sales', [sum_sales] > 5000)
)
 
Everytime i've got same resoults. Filter working per row, and calculate only products that exceed, 5000 , not  total sum of orders for each period
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tomekp0

A calculated column is an extension of a table that’s evaluated for each row . A calculated measure is not treated the same as any other table column. Unlike a calculated column, measures are evaluated on the fly with every change in context. 

So in your DAX , if you want to get the total sum of orders for each period , you can create a calculated to sum the total , then create a measure to judge with 5000 .

Ailsamsft_0-1664353322017.png

Best Regards,
Community Support Team _ Ailsa Tao
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
Anonymous
Not applicable

Hi @tomekp0

A calculated column is an extension of a table that’s evaluated for each row . A calculated measure is not treated the same as any other table column. Unlike a calculated column, measures are evaluated on the fly with every change in context. 

So in your DAX , if you want to get the total sum of orders for each period , you can create a calculated to sum the total , then create a measure to judge with 5000 .

Ailsamsft_0-1664353322017.png

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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