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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
user35131
Helper III
Helper III

Why can't I have a rank index without duplicate values

I created a rank with this code 

 

RANK = RANKX(FILTER(
    'Table',
    'Table'[ID]= EARLIER('Table'[ID]) &&
        'Table'[Date Time] < EARLIER('Table'[Date Time])
),'Table'[Date Time],,ASC,Skip)

which to some extent worked and followed the proper order but it gave me 1,1,1,4 instead of 1,2,3,4. The Date and Time is the same for the first three rows. Next thing I did was add a column with random values.

 

SupportingColumn = RANDBETWEEN(1,COUNTROWS('Table'))

 

I was hoping that I could still do the same grouping but sort it by some index cause it doesn't matter which row is before the other. However it completely disorigented my position. 

 

RANK = RANKX(FILTER(
    'Table',
    'Table'[ID]= EARLIER('Table'[ID]) &&
        'Table'[Date Time] < EARLIER('Table'[Date Time])
),'Table'[SupportingColumn],,ASC,Skip)

 

same code as before but now completely placing the values all over the place. Not sure how to do this. 

 

2 REPLIES 2
smpa01
Super User
Super User

@user35131  change

Skip to DENSE
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

So change from skip to dense doesn't solve it. What it does it changes 1,1,1,4 to 111,2. I'm more satisfied with the 1,1,1,4 because at least the 4 is in the proper position. 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors