Forum Discussion
Anonymous
6 years agoNot applicable
Calculated Column - Distinct Count By Another Column and Filter By Column
I have a table with 3 columns, Customer Number, Account Number & Flag. I want to create a calculated column(NOT A MEASURE) which counts the number of accounts per customer when the flag is set to yes...
- 6 years ago
Hello Anonymous Give this a try
Total Business Investment Products = CALCULATE ( DISTINCTCOUNT ( 'Fact'[AccountNumber] ), ALLEXCEPT ( 'Fact', 'Fact'[CustomerNumber] ), 'Fact'[Flag] = "Y" )
jdbuchanan71
6 years agoSuper User
Hello Anonymous Give this a try
Total Business Investment Products =
CALCULATE (
DISTINCTCOUNT ( 'Fact'[AccountNumber] ),
ALLEXCEPT ( 'Fact', 'Fact'[CustomerNumber] ),
'Fact'[Flag] = "Y"
)Anonymous
6 years agoNot applicable
jdbuchanan71 This works but when I use it as Filter('Fact','Fact'[Flag])='Y') it doesnt work? Do you know why?
- jdbuchanan716 years agoSuper User
I believe the ALLEXCEPT is removing the fitler added in the FILTER statement.