- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RANKX fails with more rows
Hi guys! I have simple RANKX DAX:
1. Amount RANKX =
RANKX(
ALLSELECTED('DIM_CUSTOMER'[Name]),
'1. X_Measures[Amount],,
DESC,
Dense)
It all works, I put Customer Name as Row, this measure together with Amount in values, there is a ranking visible, all works nicely.
But as soon as I add another row from different table under the Customer Name (for example Contract Number), it immediatly fails saying that it exceeded all available resources.
I assume that this calculation tries to rank further on the next row too? Can I somehow change this measure to behave correctly?
When I do it the default way (Using the built in filters, putting customer name then selecting TopN option and Amount as data), it works perfectly no matter how many drilldown are there. But the TopN is fixed there, thus my workaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've tried using IF(ISINSCOPE()) but seems it only works for rows "on top" of the one we do ranking on, the ones below still get some ranks, thus I imagine the resource issue. Still looking for solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are a few approaches you can try to address this issue:
Optimize the DAX expression: Ensure that your DAX expression is as optimized as possible. Sometimes, small changes in the DAX expression can significantly improve performance. For example, you could check if there are any unnecessary filters or columns being included in the calculation.
Use context transition: You can try using context transition functions like CALCULATE or FILTER to evaluate the RANKX expression within a smaller context, which might improve performance. For example, you could try something like:
DAXAmount RANKX = RANKX( FILTER(ALLSELECTED('DIM_CUSTOMER'[Name]), HASONEVALUE('DIM_CUSTOMER'[Name])), '1. X_Measures[Amount], DESC, Dense )This limits the calculation of RANKX to only the rows where 'DIM_CUSTOMER'[Name] has a single value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Move the measure outside the RANKX so that it will be computed only once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This measure is already computed outside.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
07-29-2022 05:12 AM | |||
08-07-2022 11:18 AM | |||
09-04-2024 12:55 PM | |||
11-27-2024 01:37 AM | |||
01-21-2025 07:01 AM |
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
9 |
User | Count |
---|---|
29 | |
16 | |
15 | |
13 | |
12 |