Forum Discussion
nele
4 years agoFrequent Visitor
Distinctcount filtered by measure
Hi, I want to use the following expression: Partners pos Delta = CALCULATE(DISTINCTCOUNT('Store Performance'[Customer Partner Name]),FILTER('Store Performance',[salesDelta]>0)) However, the ...
- 4 years ago
nele Try:
Partners pos Data = VAR __Table = FILTER( ADDCOLUMNS( SUMMARIZE('Store Performance',[Customer Partner Name]), "__salesDelta",[salesDelta] ), [__salesDelta]>0 ) RETURN COUNTROWS( DISTINCT( SELECTCOLUMNS(__Table,"Customer Partner Name",[Customer Partner Name]) ) )
Greg_Deckler
Community Champion
4 years agonele Try:
Partners pos Data =
VAR __Table =
FILTER(
ADDCOLUMNS(
ALLSELECTED('Store Performance),
"__salesDelta",[salesDelta]
),
[__salesDelta]>0
)
RETURN
COUNTROWS(
DISTINCT(
SELECTCOLUMNS(__Table,"Customer Partner Name",[Customer Partner Name])
)
)
nele
4 years agoFrequent Visitor
Greg_Deckler , maybe I need to add that the [salesDelta] is calculated per "Customer Partner Name", but this is not based on 1 row. There are multiple rows for 1 partner and based on the sum of these rows, the [salesDelta] is calculted. I think this is the reason that I cannot just add a column "salesDelta" in my dataset, since the average of the individual salesDelta's is not the same as the salesDelta of the sum of the individual rows.