Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

RANK or INDEX based on Aggregation (Average)

Hi Guys,

 

I need to create a measure or a column that provides me with RANK of products based on the AVG sales for that product show me only the top 3 products avg sales.

 

Below the raw data 

ProductSales 
a10 
a10 
b5 
c4 
d3 
d3 
   
below the average sales  
ProductAverage SalesRANK
a51
b52
c43
d34

 

The column RANK is the one I need to create

 

is that possible?

 

Thanks a lot

  • Anonymous 

    you can try to create measures

    avg = AVERAGE('Table'[Sales])
    
    Measure = RANKX(ALL('Table'[Product]),'Table'[avg],,DESC)

     

2 Replies

  • Anonymous 

    you can try to create measures

    avg = AVERAGE('Table'[Sales])
    
    Measure = RANKX(ALL('Table'[Product]),'Table'[avg],,DESC)

     

  • Hi,

    Please check the below picture and the attached pbix file.

    All measures are in the attached pbix file.