Forum Discussion

RingoSun's avatar
RingoSun
Icon for Helper II rankHelper II
4 years ago
Solved

Help me understand these measures

Okay so I shamelessly copy and pasted a DAX formula into my project and it worked. But I also want to understand how it works so please help a guy out!   Basically the measures are for a Top N slic...
  • MFelix's avatar
    4 years ago

    Hi RingoSun ,

     

    Looking at the code basically you have the following setup:


    RingoSun wrote:

     


     In this metric you are checking if there is one value selected on the TOPN table, if you have more than one value selected this metric returns false, so when you have one value of the topN you return that value, if you have more than one you return 10.


    RingoSun wrote:


    On this second measure you do the same thing so check if there is a single category select and if that is true you return the ranking of sales  based on the category


    RingoSun wrote:

     


    On this last measure you check if the Categoryrank is lower or equal to the TOPN number, so basically if the Ranking is lower or equal than your TOPN you get a value of 1 otherwise you get a value of 0 when you filter based on the 1 your visualization only presents the values that are lower than the SelectedTopNumber