Forum Discussion
Slicing two tables
- 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.
Well, if these are actually tables then what you are trying to do cannot be done because tables only update upon data load/refresh.
You would need a measure.
Okay, good to know, thanks!
However, when I tried to create a measure, I got a mistake becasue it can't find an aggregation for Table2[ID] since it's in text form.
Does this make sense? Thanks again!
- Greg_Deckler6 years ago
Community Champion
Generally you just wrap it with MAX or MIN depending on your preference. Doesn't matter what the aggregation is when it is filtered to one. Anonymous- Anonymous6 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-msft6 years ago
Community 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.