Forum Discussion
Counting rows based on value on one column that is reference in another
- 4 years ago
If my above assumption is true you may try something like
Count = CALCULATE ( COUNTROWS ( TabeName ), TREATAS ( VALUES ( TabeName[Manager Name] ), TabeName[Employee Name] ), REMOVEFILTERS ( TabeName ) )you may try it with or without the REMOVEFILTERS part
"What you are suggesting is the first thing I tried but the data structure is more complex, I am afraid." What results did you get? What kind of structure that forces such complexity? As per this sample data CONTROWS should work just fine.
Hello,
you are correct. I can aggregrate by Manager Name (or Team ID). However, I need to aggregate by managed_team_id. So how many people fall under AA1, BB1, etc. My apologies for not being precise.
- tamerj14 years ago
Community Champion
I think you mean to say that the [ID of my team] column do not actually exist and you want to create it or directly create the count measure?
- tamerj14 years ago
Community Champion
If my above assumption is true you may try something like
Count = CALCULATE ( COUNTROWS ( TabeName ), TREATAS ( VALUES ( TabeName[Manager Name] ), TabeName[Employee Name] ), REMOVEFILTERS ( TabeName ) )you may try it with or without the REMOVEFILTERS part
- AlexanderRbt4 years ago
Helper I
Hello tamerj1
I am trying to get your solution to work. I am not familiar with TREATAS and REMOVEFILTERS but both make sense in this context.
Thanks you for the gift of your time and your willingness to help a complete stranger.
Thanks
A.