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
ryan_b_fiting
Post Patron
Post Patron

RANK Dates dynamically

Hello Community - 

 

I have a set of data with part_numbers, quantities and dates.  I am looking to be able to rank the dates from newest to oldest so that I can determine if the part is one that we are actively purchasing based on the most recent 3 weeks (sometimes the part is not purchased on the date and there is no line of data for the part for the specific date).

 

I have my RANKX formula ranking the dates 

Rank ReleaseDate_Mon =
RANKX (
ALLSELECTED ( ReleaseDateRanks[ReleaseDate_Mon] ),
CALCULATE ( SELECTEDVALUE ( ReleaseDateRanks[ReleaseDate_Mon]) ),
,
DESC
)
Date.PNG
The output it is producing is correct.  However, when I try to change my date range, the rank does not dynamically change.  Those ranks remain the same when I slim my date range down.
date issue.PNG

 What I need to happen, when I change the range in the example above, I would need 2/1/2021 to have a RANK of 1 1/25/2021 to have a RANK of 2 and so on.

 

I am guessing this is a simple miss by me, but any help would be great.

 

Thanks
Ryan

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@ryan_b_fiting 

 

I've set up a small example with a simple table that only has about 10 dates, then created this measure:

Ranking = 
if( ISINSCOPE( Releases[Release Date] ),
    RANKX(
        ALLSELECTED( Releases[Release Date] ),
        CALCULATE( SELECTEDVALUE( Releases[Release Date] ) ),,
        DESC
    )
)

and it works as expected, adjusting itself to the selected range.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@ryan_b_fiting 

 

I've set up a small example with a simple table that only has about 10 dates, then created this measure:

Ranking = 
if( ISINSCOPE( Releases[Release Date] ),
    RANKX(
        ALLSELECTED( Releases[Release Date] ),
        CALCULATE( SELECTEDVALUE( Releases[Release Date] ) ),,
        DESC
    )
)

and it works as expected, adjusting itself to the selected range.

 

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

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.