Forum Discussion
Ranking by group
Hey,
first I created this measure:
count pk = COUNT('Table'[Primary Key] )
This measures just counts.
Then I created the measure that ranks the available Titles by the measure count pk like so:
rankx title by cnt pk =
RANKX(ALLSELECTED('Table'[Title]) , [count pk] , , DESC , Dense)
This allows to create a simple table visual like this:
if you wan to suppress the value for the rank measure at the Total level just use the measure like so:
rankx title by cnt pk =
IF(HASONEVALUE('Table'[Title])
,RANKX(ALLSELECTED('Table'[Title]) , [count pk] , , DESC , Dense)
,BLANK()
)
Hopefully this provides what you are looking for.
Regards,
Tom
)
- TomMartens6 years ago
Super User
Hey,
as it seems the sample data does not reflect your data model, as both measures I provided worked with the sample data you provided.
Please consider to provide a pbix file that contains sample data and represents your data model. If you have used xlsx files to create the sample data provide these files as well. Upload the files to onedrive or dropbox and share the link.
Regards,
Tom