Forum Discussion
Anonymous
5 years agoNot applicable
Distinct count for every customer row
Hi, I have two tables: DimSubjects (dimension) where I have all the customer and a FactSales (fact table) where I have sales transaction. They are related by a subject key (one to many) and I display...
- 5 years ago
Hi Anonymous
I've created the measure but please remember next time not to change the names of the fields in the visual as this makes it really much harder to work with the model for a person that has not worked with the model. Nobody wants to spend time on deciphering step by step, painstakingly, which field belongs to which table.
Here's the measure but I can't guarantee it'll be fast:
The Count = var vCurrentSubjectID = DISTINCT( 'D - Subject'[Subject ID] ) var vResult = if( NOT ISEMPTY( 'F - Sales packing slip' ), CALCULATE( DISTINCTCOUNT( 'F - Sales packing slip'[Packing slip ID] ), 'D - Subject'[Subject ID] in vCurrentSubjectID, ALLSELECTED( 'F - Sales packing slip' ) ) ) return vResult
daxer-almighty
5 years agoSolution Sage
Hi there.
It's daxer but from a home PC, so I have a different user name. Please grant access to the file as I currently can't download it. Thx.
Anonymous
5 years agoNot applicable
Hi, granted!