Forum Discussion
awitt
Helper III
4 years agoRANKX with String Filter
Hi, I am looking to rank the top 5 products based on sales. This below works for all products. Top 5 Products =
VAR ProductRank = RANKX (ALL('ePOS Bookkeeping Report'[Product]), CALCUL...
v-easonf-msft
Community Support
4 years agoHi, awitt
You can try measure as below:
Top 5 Products of CLOTHING =
VAR rank1 =
RANKX (
ALLEXCEPT (
'ePOS Bookkeeping Report',
'ePOS Bookkeeping Report'[Category (groups)]
),
CALCULATE ( SUM ( 'ePOS Bookkeeping Report'[NET Sales] ) ),
,
DESC
)
RETURN
IF (
MAX ( 'ePOS Bookkeeping Report'[Category (groups)] ) = "CLOTHING"
&& rank1 <= 5,
CALCULATE ( SUM ( 'ePOS Bookkeeping Report'[NET Sales] ) ),
BLANK ()
)
Best Regards,
Community Support Team _ Eason