Forum Discussion

matkvaid's avatar
matkvaid
Icon for Helper III rankHelper III
3 years ago

Is this possible, TOPN as matrix rows?

Hi, i am asked to do something like this - compare table. I have the measures, results are ok, but now i am also asked to make just top product comparing, i would put it in a matrix, but do not find a way how to... Any ideas is it possible?

 

 Measure1Measure2Measure3
Top10080%20%-5%
Top1050%50%-10%
Top320%80%5%

6 Replies

  • Hi 

    matkvaid 

    TOPN returns a table, which is not good for such case. Try to add a index column with RANKX and another column with SWITCH. One column directly shall also be viable.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi matkvaid 

    If you want to get the product name, you can use the TopN in the visual filter, as shown in the image below

     

     

    For details, please refer to the following links:

     TOP N Filter in Power BI with Zero DAX Code; Visual Level Filter - RADACAD

    However, if you want to display the Topn measure, you can't do it, because TopN returns multiple values and is a table, please refer to the following link for details

     TOPN DAX Function: How it works in Power BI? Comparison against the top group - RADACAD

    Best Regards,

     

    Yolo Zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • matkvaid's avatar
      matkvaid
      Icon for Helper III rankHelper III

      Hi, yes i can add topn filter, it works 🙂 But the problem is i was aksed to show few levels of top...

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi matkvaid 

         

        IF you want to display the topn measure like your picture displayed, it cannot, it returns a table

         

        Yolo Zhu

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • So if i create calculated table with TOPN, i get what i would like to, but then my calculated table does not recalculate when i apply some filters... 😄 

    • matkvaid's avatar
      matkvaid
      Icon for Helper III rankHelper III

      Still trying to find something out. If i can create calculated table, add one more columnt that just has value top100 and add to matrix, it works. So maybe it is possible with selectcolumns or something like that? I'm stugling with table functions, sorry for many stupid questions