Forum Discussion
Group By Name Then Add Column With Count Of Each Group
Hi,
I'm trying to group together names and then get a count of each group, and add the count of the records group to itself (for every row). There's an example below.
I do specifically need it to be a calculated column, and not just filtered with a visual.
If I have the following Names
[Name]
A
A
A
B
B
C
I want to end up with
[Name] | [Count]
A | 3
A | 3
A | 3
B | 2
B | 2
C | 1
Where A is 3 because there's 3 A's, B is 2 and C is 1 for similar reasons.
Anything i've been able to find so far points towards a measure, however the measure changes based on page/visual filters, and requires multiple visuals to manipulate it the way i'm trying to.
Any idea's how I can get the desired result?
Create a new column with:
Count = CALCULATE(COUNT('Table'[[Name]]]), ALLEXCEPT('Table', 'Table'[[Name]]]))
3 Replies
- camargos88
Community Champion
Create a new column with:
Count = CALCULATE(COUNT('Table'[[Name]]]), ALLEXCEPT('Table', 'Table'[[Name]]]))- s4spencerRegular Visitor
No idea why I struggled with this so much, many thanks!
- s4spencerRegular Visitor
Just as a note for anyone who has the same issue and is having "one of those days". Make sure to check that your visuals aren't "summarizing" your counts. Was so convinced I was doing something wrong before I never checked the obvious.