I have a table of data, an extract of which looks like this:
<tbody>
</tbody>
I wanted to produce a Pivot Table that looks like this:
<tbody>
</tbody>
Thanks to help from an earlier thread, I am using the following DAX formula to return the value of the Birmingham office's sales, as Birmingham has the highest sales:
=MAXX ( VALUES ( Sales[Office] ), CALCULATE ( SUM ( Sales[Sales] ) ) )
This works really well. However, I would now like to be able to return the total sales made by the office with the 2nd highest sales. Is there a DAX formula that will do this for me?
Eventually I want to give the user the ability to choose a rank (1st, 2nd, 3rd, etc.) and see the sales value for the relevant office.
Any help much appreciated.
Country | Product | Office | Sales |
UK | Shoes | Leeds | 100 |
UK | Shoes | Leeds | 100 |
UK | Shoes | Leeds | 150 |
UK | Shoes | London | 200 |
UK | Shoes | London | 340 |
UK | Shoes | London | 560 |
UK | Shoes | Birmingham | 800 |
UK | Shoes | Birmingham | 900 |
UK | Shoes | Birmingham | 2000 |
<tbody>
</tbody>
I wanted to produce a Pivot Table that looks like this:
Product | Highest Sales | Office |
Shoes | 3700 | Birmingham |
<tbody>
</tbody>
Thanks to help from an earlier thread, I am using the following DAX formula to return the value of the Birmingham office's sales, as Birmingham has the highest sales:
=MAXX ( VALUES ( Sales[Office] ), CALCULATE ( SUM ( Sales[Sales] ) ) )
This works really well. However, I would now like to be able to return the total sales made by the office with the 2nd highest sales. Is there a DAX formula that will do this for me?
Eventually I want to give the user the ability to choose a rank (1st, 2nd, 3rd, etc.) and see the sales value for the relevant office.
Any help much appreciated.