Forum Discussion
Need help with ranking
- 6 years ago
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:
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! 🙂
- 6 years ago
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)
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:
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! 🙂
JarroVGITThank you! Its working perfectly. I was making some typing mistake. Just need one more help. I want to show the rank in card after selecting name and year from slicer. Rank is coming 1 for all selected names. Its coming correctly in the table. Thank you!
- JarroVGIT6 years agoResident RockstarMeasure =
VAR _tmpTable = SUMMARIZE(ALL(Table1), Table1[Name], Table1 [Year], "SalesTotal", SUM(Table1[Sales ]))
VAR _rankedTable = ADDCOLUMNS(_tmpTable, "Rank", RANKX(_tmpTable, [SalesTotal], , DESC, Dense))
RETURN
MAXX(FILTER(_rankedTable, [Name] = SELECTEDVALUE(Table1[Name]), [Year] = SELECTEDVALUE(Table1[Year])), [Rank])
That should work:) - Ashish_Mathur6 years agoSuper User
Hi,
So if you select one year and one person, you want to know the rank of that one chosen person in that one chosen year in a card visual. Am i correct? Share some sample data that i can paste in an Excel workbook.
- Vish246 years agoHelper II
Ashish_Mathur yes...thats corrcet
- Vish246 years agoHelper II
Ashish_Mathur My data is like this:
Name Sales Year A 200 2018 A 26 2019 B 3456 2018 B 55555 2019 B 4 C 5 2019 C 55 2018 A 767 2019 C 888 2018 D 899 2019 I have multiple sales by each person. So I am ranking them for each year. So I have a slicer with name and year. I want to show their ranking in a card as per each year and if year is not selected then combina ranking for 2018+2019 sales.
- Ashish_Mathur6 years agoSuper User
Hi,
Create a slicers for Year and Name. Write this measure
Total Sales = SUM(Data[Sales])
Rank = RANKX(ALL(Data[Name]),[Total Sales])
Hope this helps.