Forum Discussion
Anonymous
6 years agoNot applicable
Slicing two tables
Hello, I’m relatively new to DAX and struggling with the following, so any help would be greatly appreciated. Apologies, if this has been asnwered already, but I couldn't find anything similar. I...
- 6 years ago
Hi Anonymous ,
You could try SELECTEDVALUE() function.
Count= CALCULATE ( COUNTA ( 'Table1'[Combination] ), FILTER ( 'Table1', SEARCH ( SELECTEDVALUE ( 'Table2'[ID] ), 'Table1'[Combination],, 0 ) ) )But I think the count of c should be 2 when you select x.
Anonymous
6 years agoNot applicable
Thank you again, and please forgive my insistence! I appreciate your patience
When I aggregate by MAX (or MIN) I get the same results for each ID level and therefore lose valuable information:
| ID | Count |
| a | 2 |
| b | 2 |
| c | 2 |
| d | 2 |
Instead of:
| ID | Count |
| a | 2 |
| b | 1 |
| c | 1 |
| d | 1 |
v-eachen-msft
6 years agoCommunity Support
Hi Anonymous ,
You could try SELECTEDVALUE() function.
Count=
CALCULATE (
COUNTA ( 'Table1'[Combination] ),
FILTER (
'Table1',
SEARCH ( SELECTEDVALUE ( 'Table2'[ID] ), 'Table1'[Combination],, 0 )
)
)
But I think the count of c should be 2 when you select x.