Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 |
---|---|
93 | |
84 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |