Forum Discussion
DAX or Measure to show top largest values
- 9 years ago
when you say its wrong , is it because the total is wrong? are you filtering on anything else? or is because its not the top, you should change your asc to desc if you want the top
in terms of the measure you should be able to, for readbility though i would probably change the measure to this
Top 2 =
VAR totalSales =
SUM ( financials[ Sales] )
RETURN
CALCULATE (
totalSales,
FILTER (
VALUES ( financials[Product] ),
IF (
RANKX ( ALL ( financials[Product] ), [Total Sales],, desc) <= 2,
[Total Sales],
BLANK ()
)
)
)
s15 first you need to rank your data by you sales
then you should return only where top 10
this video is helpful ti figure it out
I know I can rank by using filter but I'd like to learn more from DAX.