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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Stu11
Frequent Visitor

Ranking Data

Hi,

I'm trying to add a rank to the below table in PBi. Each colum (Month,Team&Emplyee,Sumber of solves are in seperate tables)

 

The rank would need to rank each employee by team by month. So each team would have it's own sperate rank each month.


Tried doing this a couple of times to no avail. Any help would be appreciated.

 

MonthTeamEmployeeNumber of solvesRank
AprilTeam1Person120 
AprilTeam2Person230 
AprilTeam3Person348 
AprilTeam4Person465 
AprilTeam5Person570 
AprilTeam1Person62 
AprilTeam2Person93 
MayTeam3Person34 
MayTeam4Person45 
MayTeam5Person56 
MayTeam1Person77 
MayTeam2Person28 
MayTeam3Person869 
MayTeam4Person1056 
JuneTeam5Person526 
JuneTeam1Person1695 
JuneTeam2Person223 
JuneTeam3Person35 
JuneTeam4Person4545 
JulyTeam5Person55647 

Thanks

2 ACCEPTED SOLUTIONS

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

Number of solves: = 
SUM ( Data[Number Of Solves] )

 

Ranking per Month and per Team: = 
VAR employeetable =
    ALLEXCEPT ( Data, 'Calendar'[Month], Team[Team] )
RETURN
    IF (
        HASONEVALUE ( Employee[Employee] ) && NOT ISBLANK ( [Number of solves:] ),
        RANKX ( employeetable, [Number of solves:],, DESC )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

Hi,

 

In your example:

 

"ALLEXCEPT ( Data, 'Calendar'[Month], Team[Team] )"

 

I don't have a table named "data". All the tales are joined using a relationship. 

Do I need to look at Crossjoin in order to get this to work?

 

Thanks,

View solution in original post

12 REPLIES 12
Stu11
Frequent Visitor

Hi again,

 

Got it working using a summazried table.

 

"

Solved/Closed Ticket Ranking =
VAR Currentmonth = 'Summary Table'[MonthYear]
VAR Currentteam = 'Summary Table'[Team]
VAR newtable = filter('Summary Table','Summary Table'[MonthYear]=Currentmonth && 'Summary Table'[Team] = Currentteam)

RETURN

rankx(newtable,'Summary Table'[Numer of Solved/Closed Tickets],,DESC,Dense)"
 
Is the code above how could I make it so the rank ignore blanks?
 
Thanks,
 
Stu
Stu11
Frequent Visitor

Hi again,

 

Got it working by creating a summary table. Using your code earlier. 

 

Quick question, how can i make so the ranking ignore blanks (within the "

'Summary Table'[Number of Tickets]" column?

 

"

Solved/Closed Ticket Ranking =
VAR Currentmonth = 'Summary Table'[MonthYear]
VAR Currentteam = 'Summary Table'[Team]
VAR newtable = filter('Summary Table','Summary Table'[MonthYear]=Currentmonth && 'Summary Table'[Team] = Currentteam)
RETURN

rankx(newtable,'Summary Table'[Number of Tickets],,DESC,Dense)"
 
Thanks,
 
Stu
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your expected outcome looks like, but please check the below picture and the attached pbix file.

It is for creating a new column.

 

Picture1.png

 

Rank Employee by Team and by Month CC =
VAR currentmonth = Data[Month]
VAR currentteam = Data[Team]
VAR newtable =
    FILTER ( Data, Data[Month] = currentmonth && Data[Team] = currentteam )
RETURN
    RANKX ( newtable, Data[Number Of Solves],, DESC )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi,

The outcome is perfect. Only issue is that these fields are not in the same table. The relate to one another.

 

Table examples, Month,Team/Employee,Count of solved. This means I cannot create a new column.

 

Would I need to create a new table?

Hi,

Thank you for your message.

Please correct me if I missed something from your question, but is it separated by month? or by team? How many separared tables do you have? 

If it is OK with you, could you please show how the each table looks like?

Thank you.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi again, thank you for your time so far.

 

I guess what I'm asking for is what you've done so far but as a measure. If that is even possible.

DimCalendar[Month]

Company[Team]/Company[Emplyee]

Data[Number of Solves]

Each of the table have a relatopship between them.

 

Hope this makes sense. 

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

Number of solves: = 
SUM ( Data[Number Of Solves] )

 

Ranking per Month and per Team: = 
VAR employeetable =
    ALLEXCEPT ( Data, 'Calendar'[Month], Team[Team] )
RETURN
    IF (
        HASONEVALUE ( Employee[Employee] ) && NOT ISBLANK ( [Number of solves:] ),
        RANKX ( employeetable, [Number of solves:],, DESC )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi,

 

I have copied this and with my version the rank is only ever 1 or blank.


Not sure as to why. I will try and investigate.

 

Thanks,

Stu11
Frequent Visitor

Hi,

 

Cannot seem to figure out why it's not working. Any other suggestions?

 

Thanks,

Hi,

Please share your sample pbix file, and then I can try to have a look into it to come up with a more accurate solution.

Thanks.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi,

 

In your example:

 

"ALLEXCEPT ( Data, 'Calendar'[Month], Team[Team] )"

 

I don't have a table named "data". All the tales are joined using a relationship. 

Do I need to look at Crossjoin in order to get this to work?

 

Thanks,

Hi,

 

I believe the issue is I don't have a table named "data" where all this data resides. My data is in 3 sperate tables (although they do have a relationship). 

Thanks,

 

Stu

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors