Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
Please consider following senario:
Data is:
Name | Date |
A | 01/09/2016 |
A | 02/09/2016 |
A | 03/09/2016 |
A | 04/09/2016 |
A | 05/09/2016 |
B | 01/09/2016 |
B | 01/09/2016 |
B | 02/09/2016 |
B | 02/09/2016 |
B | 02/09/2016 |
B | 03/09/2016 |
C | 05/09/2016 |
D | 02/09/2016 |
E | 03/09/2016 |
F | 04/09/2016 |
F | 04/09/2016 |
I want to add a new column to it to have the total number of rows per individual. I don't want measure, I want a column. With measure I know how to do it. my need is with column.
Desired output is:
Name | Date | Count |
A | 01/09/2016 | 5 |
A | 02/09/2016 | 5 |
A | 03/09/2016 | 5 |
A | 04/09/2016 | 5 |
A | 05/09/2016 | 5 |
B | 01/09/2016 | 6 |
B | 01/09/2016 | 6 |
B | 02/09/2016 | 6 |
B | 02/09/2016 | 6 |
B | 02/09/2016 | 6 |
B | 03/09/2016 | 6 |
C | 05/09/2016 | 1 |
D | 02/09/2016 | 1 |
E | 03/09/2016 | 1 |
F | 04/09/2016 | 2 |
F | 04/09/2016 | 2 |
Please advise.
Thanks.
Solved! Go to Solution.
an alternative to @KHorseman's solution above would be
Alt RowCount = CALCULATE ( COUNTROWS('Table'), ALLEXCEPT('Table', 'Table'[Name]) )
RowCount = CALCULATE( COUNTROWS(TableName), FILTER( ALL(TableName), TableName[Name] = EARLIER(TableName[Name]) ) )
Proud to be a Super User!
an alternative to @KHorseman's solution above would be
Alt RowCount = CALCULATE ( COUNTROWS('Table'), ALLEXCEPT('Table', 'Table'[Name]) )
Oh yeah, that works too. I've had to do this in a few of my reports recently, but it usually has some other complicated conditions that made the ALLEXCEPT method much messier to write, so I sort of forgot it was an option.
Proud to be a Super User!
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |