Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to get the top 5 Marks for the years 2021 and year 2022.
Here is the problem statement:
When I am selecting an Individual year, I am getting the top 5 marks from the table, but when I am selecting both year from the Slicer, I am not getting the expected output. I am using the TOP N filter from the Filter panel for Marks.
Note: I have 1000+ rows like this in the real dataset, this is just for the sample.
My expected output would be-
Thanks
Solved! Go to Solution.
Hi, @amikm
According to your description, I think you can create a measure and use it in filter pane to display the top 5.
Like this:
Top5 =
RANKX (
SUMMARIZE ( ALLSELECTED ( 'Table Top' ), [Year], [Name] ),
CALCULATE ( SUM ( 'Table Top'[Marks] ) ),
,
desc,
DENSE
)
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
Hi, @amikm
According to your description, I think you can create a measure and use it in filter pane to display the top 5.
Like this:
Top5 =
RANKX (
SUMMARIZE ( ALLSELECTED ( 'Table Top' ), [Year], [Name] ),
CALCULATE ( SUM ( 'Table Top'[Marks] ) ),
,
desc,
DENSE
)
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
@amikm , Assume you have measure marks, Create rank like this
rankx(filter(summarize(allselecetd(Table), Table[year], Table[name]), [year] = max([year])), [marks],,desc,dense)
if you need across year
rankx(summarize(allselecetd(Table), Table[year], Table[name])), [marks],,desc,dense)
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
User | Count |
---|---|
74 | |
73 | |
39 | |
25 | |
24 |
User | Count |
---|---|
96 | |
93 | |
51 | |
43 | |
42 |