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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
smpa01
Community Champion
Community Champion

Ranking issue

I am fetching data from a SSAS server and want the dataset to return a Ranking value written as a meaure

 

My base table is like this

| fiscal_period 	| Index 	|
|---------------	|-------	|
| 202301        	| 1     	|
| 202302        	| 2     	|
| 202301        	| 3     	|
| 202303        	| 4     	|

 

I want the query to return

| fiscal_period 	| Index 	| Ranking 	|
|---------------	|-------	|---------	|
| 202301        	| 1     	| 1       	|
| 202302        	| 2     	| 2       	|
| 202301        	| 3     	| 1       	|
| 202303        	| 4     	| 3       	|

 

I tried with WINOW function on a large table which generates following error

Resource Governing: This query uses more memory than the configured limit. The query — or calculations referenced by it — might be too memory-intensive to run. To run this query, you could simplify the query or its calculations, or reach out to your capacity administrator to see if they can increase the per-query memory limit.

 

//works fine without WINDOW function
DEFINE MEASURE fact[fp]= MAX(fact[fiscal_period])
MEASURE fact[rank_1] = RANKX(ALLSELECTED(fact),[fp],,ASC,Dense)

//generates error -- tested on a small table and works fine
MEASURE fact[rank_2] = RANKX(WINDOW(1,ABS,1,REL,DISTINCT(ALLSELECTED(fact))),[fp],,ASC,Dense)

SUMMARIZECOLUMNS(fact[col1]....fact[coln], "rank",[rank_2])

 

Is there a workaround?

@jeffrey_wang @CNENFRNL @AlexisOlson @TomMartens 

 

Thnak you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
jeffrey_wang
Power BI Team
Power BI Team

Stay with RankX. We'll release a new ranking function that's based on the window function architecture.

View solution in original post

2 REPLIES 2
jeffrey_wang
Power BI Team
Power BI Team

Stay with RankX. We'll release a new ranking function that's based on the window function architecture.

@jeffrey_wang  Thanks !!! looking forward to it

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.