Forum Discussion
Kristian_nho
Helper I
4 years agoFilter out data in a measure without using the FILTER expression
Hello,
I have written a measure that distinct counts customers if they have positive Sales data:
Customer Count =
CALCULATE(
DISTINCTCOUNT( Customer[Customer ID] ),
FILTER( SalesTable , [NetSales] > 0 )
)
--NetSales is a measure that simply sums up the Net Sales
This measure gives me the correct information but it tends to exceed the available resources in a matrix visual.
Is there a way to rewrite this measure by not using the FILTER expression in order to improve performance?
Thank you in advance.
Kristian_nho , Try like
CALCULATE(
Countx(filter( values( Customer[Customer ID] ), [NetSales] > 0 ),[Customer ID]
))
2 Replies
- amitchandak
Super User
Kristian_nho , Try like
CALCULATE(
Countx(filter( values( Customer[Customer ID] ), [NetSales] > 0 ),[Customer ID]
))- Kristian_nho
Helper I
Perfect, that worked like a charm. Thank you