Solved

RANK X - Rank products by revenues - Powerpivot (DAX)

Posted on 2016-07-29
6
47 Views
Last Modified: 2016-07-29
Attached is a spreadsheet containing a sales transactions table. On the sales by part sheet you will see I have created a simple pivot table from a PowerPivot model. I would like to create a measure that will rank the part codes by revenue.

Can anyone help me with a measure and explain the basic logic behind it.

I am novice with DAX but would like to learn more so the logic helps.

Thanks
Mike
0
Comment
Question by:mikes6058
  • 3
  • 3
6 Comments
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41734523
HI Mike - no attachment.
0
 

Author Comment

by:mikes6058
ID: 41734527
Sorry Rob
trans_B.xlsx
0
 
LVL 32

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 41734532
In your pivot you can simply drag the salestotal into the value field again and then change the settings on the second occurence to show Rank.

In the Field List Navigation pane. Drag SalesTotal to the bottom right pane. Click on the drop-down option for the second occurrence and choose Value Field Settings. Partway down the window there are two page tabs, choose "Show Values As".  Then choose the drop-down list just below the tabs. In this list there are a couple of options for Rank, Small to large and Large to Small. Large to Small will rank the highest value as number 1.

Thanks
Rob H
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:mikes6058
ID: 41734545
Thanks Rob,

This would work in this isolated scenario however going forward I would like to be able to view rankings by sub groups.

For example number 1 and 2 rank for a particular product group.

Would you be able to provide the DAX solution?

I'm also working towards a solution similar to the one explained in the link below.

 http://www.powerpivotpro.com/2014/11/displaying-top-n-bottom-n-and-all-others/

Mike
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41734555
Sorry, don't know anything about DAX.
0
 

Author Closing Comment

by:mikes6058
ID: 41734561
No problem, points for the alternative solution.

btw, I will be posting a number of other questions that won't involve DAX

Mike
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now