Forum Discussion
MEHUL123
1 year agoFrequent Visitor
Conditional distinct count dax
Hi, Request your help to create DAX for Distinct count of IDs against each Name rows in table. (desired result shown in last colunms) Name ID NO. DAX for Desired Result (Distinct ID ag...
- 1 year ago
MEHUL123 Try this. PBIX is attached below signature.
Distinct Count = VAR __Name = MAX( 'Table'[Name] ) VAR __Table = FILTER( ALLSELECTED( 'Table' ), 'Table'[Name] = __Name ) VAR __Group = SUMMARIZE( __Table, [Name], [ID] ) VAR __Result = COUNTROWS( __Group ) RETURN __Result
Greg_Deckler
1 year agoCommunity Champion
MEHUL123 Try this. PBIX is attached below signature.
Distinct Count =
VAR __Name = MAX( 'Table'[Name] )
VAR __Table = FILTER( ALLSELECTED( 'Table' ), 'Table'[Name] = __Name )
VAR __Group = SUMMARIZE( __Table, [Name], [ID] )
VAR __Result = COUNTROWS( __Group )
RETURN
__Result