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.
Hello! I'm trying to convert a set of disparate dates into numbers (or indicators - text is fine) indicating the most recent in a group, next most recent in a group, etc. For instance:
turn this:
Store | Date |
A | 9/1/2019 |
A | 5/1/2019 |
A | 3/1/2019 |
A | 1/1/2019 |
B | 8/1/2019 |
B | 7/15/2019 |
B | 6/3/2019 |
B | 4/1/2019 |
C | 7/16/2019 |
C | 6/1/2019 |
C | 5/1/2019 |
C | 4/1/2019 |
D | 2/1/2019 |
D | 1/1/2019 |
D | 12/15/2018 |
D | 11/1/2018 |
into this:
Store | Date |
A | 1 |
A | 2 |
A | 3 |
A | 4 |
B | 1 |
B | 2 |
B | 3 |
B | 4 |
C | 1 |
C | 2 |
C | 3 |
C | 4 |
D | 1 |
D | 2 |
D | 3 |
D | 4 |
I get the sense that this will be accomplished through the group by function - but I can't figure out how! I'm open to M or Dax solutions! Thanks!
Solved! Go to Solution.
You can rank the dates for each store
Calc Column = RANKX ( FILTER ( TableName, [Store] = EARLIER ( [Store] ) ), [Date],, DESC )
You can rank the dates for each store
Calc Column = RANKX ( FILTER ( TableName, [Store] = EARLIER ( [Store] ) ), [Date],, DESC )
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 |
---|---|
114 | |
98 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |