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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
stochasticKL
Frequent Visitor

RANKX of a summary using three (3) columns / dimensions

Hi, 

I have a source table with four dimensions: Region > Country > Area > Store and a value column Sales. I want to create a measure that will rank each store inside an area depending on its sales. I tried to replicate solutions here in the community were there are only two columns. Something similar to this: 

STORE_RANKING = 
RANKX ( 
  FILTER ( 
    ALL ( 
      Table[Region],
      Table[Country],  
      Table[Area],
      Table[Store]
    ),
    Table[Store] = MAX ( Table[Store] )
  ),
  CALCULATE ( 
    SUM ( Table[Sales] )
  )
)

I think I'm missing the logic behind calling all Store Values only for a specific Region && Country && Area. The output should look similar to this: 

RegionCountryAreaStoreSalesRank
R1AXS0121
R1AXS112
R1AYS2201
R1AYS392
R1AYS453
R1AZS5301
R1AZS672
R1BXS7481
R1BXS8112
R1BYS9241
R1BYS0192
R1BYS173
R1BZS2501
R1BZS3392
R1BZS463
R2AXS5331
R2AXS6232
R2AYS7441
R2AYS8402
R2AYS913
R2AZS0361
R2AZS162
R2BXS2481
R2BXS3212
R2BYS4261
R2BYS5162
R2BYS653
R2BZS791
R2BZS872
R2BZS933

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

hi @stochasticKL ,

 

please check following steps as below:

 

1. create Measure = SUM('Table'[Sales])

2. Create Measure 2 = RANKX(ALL('Table'[Store]),[measure])

 

Result would be shown as below:

Capture.PNG

BTW, Pbix  as attached.

Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

hi @stochasticKL ,

 

please check following steps as below:

 

1. create Measure = SUM('Table'[Sales])

2. Create Measure 2 = RANKX(ALL('Table'[Store]),[measure])

 

Result would be shown as below:

Capture.PNG

BTW, Pbix  as attached.

Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.