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
lha
Helper I
Helper I

rank to start over when it reaches max

 Hello Everyone,

 

I want to rank a set of dates from 1 to 13, once 13 as been reached, I would like the rank to start over again at one and keep on doing this until the end of my time period.

 

1/1/18 : rank 1

1/2/18:  rank 2

.

.

.

1/13/18: rank 13

1/14/18: rank 1

1/14/18: rank 2

 

Is this possible? 

3 ACCEPTED SOLUTIONS
edhans
Super User
Super User

Try this:

Ranking - TRUNC((Ranking-1)/13,0) * 13

Ranking is your RANKX() measure.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

If you already have a [Rank] measure then this should work:

 

Column 2 = 
VAR __mod = MOD([Rank],13)
RETURN IF(__mod=0,13,__mod) 

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

They both works! Thank you!

View solution in original post

4 REPLIES 4
edhans
Super User
Super User

Try this:

Ranking - TRUNC((Ranking-1)/13,0) * 13

Ranking is your RANKX() measure.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

They both works! Thank you!

Greg_Deckler
Super User
Super User

I created a similar measure to this here: https://community.powerbi.com/t5/Quick-Measures-Gallery/Cthulhu/m-p/509739

 

Probably could do something similar with RANKX but I'd need sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

If you already have a [Rank] measure then this should work:

 

Column 2 = 
VAR __mod = MOD([Rank],13)
RETURN IF(__mod=0,13,__mod) 

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.