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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
StuartSmith
Power Participant
Power Participant

Ranked Column based on "Start Date" per User/Quarter.

 

 

I have a table similar to the below where it counts the number of "Half" days a user has within each quarter.  So "Jane Doe" had 2 "Half" days in "Q2 2023" and "John Smith" had 3 "Half" days in "Q3 2023".  

StuartSmith_0-1716385087831.png

I am now trying to create a new column that will RANK "Half" days per user & quarter based on "Start Date". Hope that makes sense.

StuartSmith_1-1716385821333.png

Thanks in advance.

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@StuartSmith 

pls try this

rank =
var _start=minx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[quarter year]=EARLIER('Table'[quarter year])&&'Table'[Duration]="Half"),'Table'[Start Date])
return if('Table'[Duration]<>"Half",0,countx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[quarter year]=EARLIER('Table'[quarter year])&&'Table'[Start Date]>=_start&&'Table'[Start Date]<=EARLIER('Table'[Start Date])&&'Table'[Duration]="Half"),'Table'[Name]))
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@StuartSmith 

pls try this

rank =
var _start=minx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[quarter year]=EARLIER('Table'[quarter year])&&'Table'[Duration]="Half"),'Table'[Start Date])
return if('Table'[Duration]<>"Half",0,countx(FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[quarter year]=EARLIER('Table'[quarter year])&&'Table'[Start Date]>=_start&&'Table'[Start Date]<=EARLIER('Table'[Start Date])&&'Table'[Duration]="Half"),'Table'[Name]))
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks Ryan, that looks like it done the trick and worked. Just need to test throughly, but thanks.

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.