Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
JoeCochran
Frequent Visitor

Group by most recent date, then next most recent, etc

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:

StoreDate
A9/1/2019
A5/1/2019
A3/1/2019
A1/1/2019
B8/1/2019
B7/15/2019
B6/3/2019
B4/1/2019
C7/16/2019
C6/1/2019
C5/1/2019
C4/1/2019
D2/1/2019
D1/1/2019
D12/15/2018
D11/1/2018

 

into this:

StoreDate
A1
A2
A3
A4
B1
B2
B3
B4
C1
C2
C3
C4
D1
D2
D3
D4

 

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!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@JoeCochran 

 

You can rank the dates for each store

 

Calc Column =
RANKX ( FILTER ( TableName, [Store] = EARLIER ( [Store] ) ), [Date],, DESC )

 


Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@JoeCochran 

 

You can rank the dates for each store

 

Calc Column =
RANKX ( FILTER ( TableName, [Store] = EARLIER ( [Store] ) ), [Date],, DESC )

 


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.