Forum Discussion
n2p2gupta
9 years agoFrequent Visitor
Calculate cumulative count by looking values in a column
How can I create a column "Result" below by keepin a count of repeating values from Col1? Thanks.
Col 1 Result
a 1
b 1
a 2
c 1
b 2
a 3
c 2
3 Replies
- Eric_ZhangMicrosoft Employee
n2p2gupta wrote:
How can I create a column "Result" below by keepin a count of repeating values from Col1? Thanks.
Col 1 Result
a 1
b 1
a 2
c 1
b 2
a 3
c 2
You need an index column to indicate the rows order.
Then create a calculated column as
Result = RANKX ( FILTER ( 'Table', 'Table'[Column1] = EARLIER ( 'Table'[Column1] ) ), 'Table'[Index], , ASC, DENSE ) - n2p2guptaFrequent Visitor
Thanks Eric!
- Eric_ZhangMicrosoft Employee