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
Anonymous
Not applicable

Ranking DAX

Hi, I have this table:

 

11.jpg

 

- One Year has different Cycles

- There are some Teams with Points in those Cycles

 

I need to have the ranking of those teams based on the SUM of Points made in those particular Cycles:

 

In the example, Team B is the FIRST in Cycle 1 and SECOND in Cycle 2 for the same Year.

22.jpg

 

 

Which is the best way to have this Rank as a Calculated column?

Thanks

 

1 ACCEPTED SOLUTION

11 REPLIES 11
AntrikshSharma
Community Champion
Community Champion

Try this:

Rank =
VAR YearSold = Cycles[Year]
VAR CycleNum = Cycles[Cycle]
VAR SameCycles =
    FILTER ( Cycles, Cycles[Year] = YearSold && Cycles[Cycle] = CycleNum )
VAR Result =
    RANKX ( SameCycles, Cycles[Points],, DESC )
RETURN
    Result

cycle.PNG

Anonymous
Not applicable

Thank you, this can work. One detail is that I need to have the cumulate Points in the Year, so in the example, the sum of points to calculate ranking needs to be cumulative for the YEAR:

 

Screenshot_2.jpg

So the first Cycle of the YEAR stays equal but in Cycle 2 I am summing Cycle 1 & 2 , and so in th Cycle 3 I have to sum Cycles 1,2,3 and so on.

 

How would be the DAX adjustment?

Thanks a lot

Like this?

cycle 1.PNG

Anonymous
Not applicable

Hi Thanks , is almost like that but the TEAM needs to be consider to SUM the Points of each TEAM in the CUMULATIVE POINTS

10+30, 20 +15, 5+2 Is this how you want?
Anonymous
Not applicable

Exactly , ranking bases on all the teams in one specific Round and Year

That's simple you could use this:

1234.PNG

 

Anonymous
Not applicable

But the 40,35,7 values needs to appear only in the CYCLE 2, because the cumulative points are related to Campaign / Cycle/ Team

Like this?

 12345.PNG

@Anonymous , Try like

Year cycle team rank= RANKX(FILTER(ALL('Table'[Year],'Table'[Cycle],'Table'[Team]),'Table'[Year]=max('Table'[Year])
,'Table'[Cycle]=max('Table'[Cycle])),calculate(sum(table[CUMULATIVE POINTS])))

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.