Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Rankx in Direct Query Mode

Rankx function needs to be supported in Direct Query Mode. If I am not using Analysis Services I should be able to still create a measure of Rank and also create things like Top 10 etc..
Status: Needs Votes
Comments
dylan_morgan
New Member
'You can use countx over a filtered table to get this result. Essentially you want to iterate over a table. The basic implementation is as follows. You would want to decide how to handle ties and make adjustments, but for a simple implementation this will work. = VAR thisSales = EmployeeSales[Sales] RETURN COUNTX( FILTER( ALL('EmployeeSales'), 'EmployeeSales'[Sales] > thisSales ), [Sales] ) + 1
fbcideas_migusr
New Member
Status changed to: Needs Votes