Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Is there a way I can get a running count based on a reoccuring value in a column, and start a new running count based on new values? Please see the example below for what I am trying to achieve. When defining where to start counting, the data would most likely be sorted by a date column. Thank you!
ID | Desired Output |
A | 1 |
A | 2 |
A | 3 |
A | 4 |
A | 5 |
B | 1 |
B | 2 |
B | 3 |
B | 4 |
C | 1 |
C | 2 |
C | 3 |
D | 1 |
D | 2 |
D | 3 |
D | 4 |
E | 1 |
E | 2 |
E | 3 |
E | 4 |
E | 5 |
C | 4 |
A | 6 |
A | 7 |
According to your description, you are actually need to create a Rank column based on a date column within each ID group. Right?
You can create a calculated column like below:
RankWithinGroup Column = RANKX ( FILTER ( Table, Table[ID] = EARLIER ( Table[ID] ) ), Table[Date], , ASC, DENSE )
Regards,
Can this be done in the edit queries screen as a column with new values? Ideally I would like to use this value to create a new key for the table it resides in.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
86 | |
86 | |
84 | |
67 | |
49 |
User | Count |
---|---|
131 | |
110 | |
97 | |
71 | |
67 |