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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
prakash11440278
Post Prodigy
Post Prodigy

Rank - Partition By Year & Cycle

HI All,

How to acheive the below desired output using DAX. Please help.

 

Actual DataActual DataActual DataActual DataActual DataExpected Output
yearcycle typernr_sequenceRank
20214 A11
20214 B122
20214 C33
20214 D44
20214 E55
20214 F66
20214 G77
20214 H88
20214 I109
20214 J1110
20201 A11
20201 B42
20201 C33
20201 D24
20201 E55
1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @prakash11440278 

 

According to your needs, I think you can create a column.

Like this:

Rank =
RANKX (
    FILTER (
        'Table',
        [year] = EARLIER ( 'Table'[year] )
            && [cycle] = EARLIER ( 'Table'[cycle] )
    ),
    [type],
    ,
    ASC
)

 

vjaneygmsft_0-1645609819118.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

 

Best Regards,

Community Support Team _Janey

 

View solution in original post

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @prakash11440278 

 

According to your needs, I think you can create a column.

Like this:

Rank =
RANKX (
    FILTER (
        'Table',
        [year] = EARLIER ( 'Table'[year] )
            && [cycle] = EARLIER ( 'Table'[cycle] )
    ),
    [type],
    ,
    ASC
)

 

vjaneygmsft_0-1645609819118.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

 

Best Regards,

Community Support Team _Janey

 

Anonymous
Not applicable

Try This Measure

 

 

Rank = 
RANKX (
    FILTER (
        ALL ('Table'[YEAR],'Table'[type] ),
       'Table'[YEAR] = MAX ( 'Table'[YEAR] )
    ),
    CALCULATE (MAX( ( 'Table'[type] ) )
),,ASC)

 

 

amitchandak
Super User
Super User

@prakash11440278 , Assume you need a column rank

 

rankx(filter(Table, [Year] =earlier([Year]) ), [type],,asc,dense)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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