Forum Discussion
juncco888
3 years agoAdvocate I
New Column with count based on Values from two columns
Hi Everyone,
I am hoping this is simple for someone here but I have been having a devil of a time getting the result I need.
Here is my table
I want a new column that I will call Nr in EG that counts the number of distinct schools numbers within an enrollmen group so the results would look like this
| SchNr | Enrollment Groups | Nr in EG |
| 15 | <100 | 1 |
| 110 | 201-350 | 2 |
| 123 | >350 | 2 |
| 134 | 100-200 | 1 |
| 163 | 201-350 | 2 |
| 167 | >350 | 2 |
I have measures that give me this count for each enrollment group already but I need a single column that tells me the total number of schools so next to a school i can see the number of schools that are in the same enrolment group.
Any assitance would be greatly appreciated.
Thanks
Kyle
Edit: Corrected expected output
juncco888 add column using following DAX:
Count = CALCULATE ( COUNT ( School[SchNr] ), ALLEXCEPT ( School, School[Enrollment Groups] ) )