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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Rank in direct query mode

Hi,

 

How would I go about ranking values in direct query mode.  The DAX function RANK does not seem to work.

 

Any help appreciated

 

TIA

 

Chris

1 ACCEPTED SOLUTION
hemanth
New Member

Looks like it is not supported . It should get added as a feature

View solution in original post

6 REPLIES 6
ukeasyproj
Helper II
Helper II

I faced this a couple of months ago

 

two ways to do this, you can create a Measure using rankx 

 

this means that when you slice your data, your rankings get recalculated

 

another option is to do the rank within the SQL select query

 

this means your ranking remains the same regardless of how you slice your data

 

this will show you how to do it the SQL way: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=109028

 

 

Thank you so much for your reply. I tried the RANKX way but I got an error saying the RankX function is not supported under direct query model. How did you solve it? By rankx or SQL ? 

go to file->options and settings -> options

 

under direct query, select "allow unrestricted measures"

That's a right way to do it. However, all DAX functions are only allowed to apply in measures. I want to add each serial number 's rank as a new column as by comparing their timestamp and then focus on test data from the same rank, like how many failures do I got on the first run. I don't really think I could handle that with one single measure.

pandakillsalot
Helper II
Helper II

Did you work it out?

hemanth
New Member

Looks like it is not supported . It should get added as a feature

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.