Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Top N dynamic variable

Hello,

 

I have seen plenty of posts about how to change the 'N' in a Top N function, but I haven't seen anything about being able to create a function that lets you change what the Top N is based off of. For example the top 5 selling items by sales volume might be different than the top 5 selling items by sales $. Does anybody know how I would be able to change what the top N is based off of? Thanks in advance!

1 Reply

  • Anonymous I think you should create a dynamic measure based on what top n you want on and then use that measure in Top N measure, just an example

     

    Measure for Top N =
    IF ( SELECTEDVALUES ( Table[Slicer] ) = "Qty",
    SUM ( Sales[Qty] ),
    SUM ( Sales[Amount )
    )