Forum Discussion

manideep547's avatar
manideep547
Helper III
6 years ago
Solved

top 5

I have 3 tables A, B, and C. In table A I have stores_Names, Id, In table B I have order_location,customer_ID and In table C I have a location, System_ID columns based on the visits(No of times he/she visits that store). I have to display the top 5 stores in power bi.

  • mwegener's avatar
    mwegener
    6 years ago

    Hi manideep547 

     

    You may download my PBIX file from here.
    Hope this helps.

     

    If I answered your question, please mark my post as solution, this will also help others.

    Please give Kudos for support.

  • mwegener's avatar
    mwegener
    6 years ago

    Hi manideep547 ,

     

    there a two solutions in this .pbix file.

     

    1. table PQ = Used Power Query to combine (Append) the three tables.

    2. Relation & Measure = Used relationships across a stores dimension table to sum the values to a measure.

     

10 Replies

  • mwegener's avatar
    mwegener
    Most Valuable Professional

    Hi manideep547 ,

     

    i think the easiest way is the use of the "TOP N" Filter in the Filter pane.

     

    If I answered your question, please mark my post as solution, this will also help others.

    Please give Kudos for support.

    • manideep547's avatar
      manideep547
      Helper III

      from filters, we can filter the top 5 stores from a single table. But I want to show the top 5 stores from different tables.
       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi manideep547 ,

    Add below measure to calculate top 5.

    TOP =
    Var Rnk= RANKX(ALL(Sample1[StoreName]),CALCULATE(COUNT(Sample1[ID])),,DESC,Skip)
    RETURN
    IF(Rnk<=5,CALCULATE(COUNT(Sample1[StoreName])),BLANK())


    Best Regards,
    Mail2inba4

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