Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |