Forum Discussion
Show Top N values in Table
Hello, I am using Power BI Desktop with SSAS. I have one table downloaded from a cube.
Table Name: Intake. I have an Intake Count and a Completed By column. I am trying to create a column that will sum the top 10 "Completed By" people so I can display it using the top down filter visual.
I am having problems with the syntax. I have reviewed articles re RankX, TopN, Summarize, etc. but I have not been able to nail down the syntax. On one try I got a circular data issue.
Any help would be appreciated.
Thank you!
Are you adding it as a calculated column? (not a measure)?
And did you cut and paste all text, including brackets?
Here is a basic version of the data in a PBIX file you can download
8 Replies
- Phil_SeamarkMicrosoft Employee
Hi Anonymous
Do you have some sample data of what your table looks like?
- AnonymousNot applicable
I don't seem to be able to cut and paste a snapshot of the columns. Does this help?
TableName: Intake
Column1: Intake Count Whole Number
Column2: Completed By Text
I am displaying the data for one year.
- Phil_SeamarkMicrosoft Employee
Hi Anonymous
This calculated column, when added to your Intake table, will show the sum total of the top 10 values by [Intake]. If this is not exactly what you need, let me know and I will tweak the calculation for you :)
New Column = VAR myRank = TOPN(10,ALL('Intake'),[Intake Count],DESC) RETURN SUMX(myRank,[Intake Count])