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
Vish24
Helper II
Helper II

Need help with ranking

Hello,

I am really struggling in ranking my data. I have data like this:

Name   Sales  Year

A           100    2019

A           50     2019

A           25     2018

B          100    2019

B          75      2018

C          20     2019

B          45     2018

 

I have Sales by Many people with different years. One Person has many sales in a year. Now, I want to rank them for their sales by year. I am making a slicer for Names and Year. I want to show the ranking as per the selected name and year.

So my data should be rank separately for each year.

 

Please help! 

 

 

2 ACCEPTED SOLUTIONS
JarroVGIT
Resident Rockstar
Resident Rockstar

Hi @Vish24 ,

 

You can use a measure like this:

Measure = 
VAR _tmpTable = SUMMARIZE(ALLSELECTED(Table1), Table1[Name], "SalesTotal", SUM(Table1[Sales ]))
VAR _rankedTable = ADDCOLUMNS(_tmpTable, "Rank", RANKX(_tmpTable, [SalesTotal], , DESC, Dense))
RETURN
MAXX(FILTER(_rankedTable, [Name] = SELECTEDVALUE(Table1[Name])), [Rank])

Resulting in a visual like this:

image.png

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Check

https://www.dropbox.com/s/ps1475oidzubmud/yearsalesemployerank.pbix?dl=0

 

I think category rank will do

Rank = RANKX(ALL(yearsalesemployerank[Name]),CALCULATE(SUM(yearsalesemployerank[Sales])),,DESC,Skip)

View solution in original post

21 REPLIES 21

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.