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 remove the [ brackets i think you using a variable
Thank you vanessafvg
I make it a variable but now it seems not to be working. I think DESC with 2 is OK but somehow it doesn't filter two products.
- vanessafvg9 years ago
Community Champion
s15 can you bring the ranking back as well? ive picked up one issue and that is the
CALCULATE(SUM ( Sales[TotalCost] ))
need to have a calculate in front of it as all the ranking one will be 1.
i think the calculation is incorrect, need to check it out properly on video, will look at later