Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Rank Based on Multiple Columns Coming From Multiple Tables

Hi Friends,

 

I am troubling in filtering table result based on mutiple columns which are coming from multiple tables. For an exmaple below is the sample matrix visual.

Product NamePlantCustomerShort qty
A1C1455
A2C1343
B3C2545
B4C3534
C1C1665
C2C3332
D3C2543
D4C1566

 

Columns "Product Name", "Plant", "Customer" are all coming from different tables.

 

Now i need to filter this matrix visual based on Short Qty i.e. Top 3

 

Product NamePlantCustomerShort qty
C1C1665
D4C1566
B3C2545

 

Please help me here with measure or any other trick.

 

amitchauhan @gregdorval @amitchandak @JihwanKim @Jihwan_Kim @ChandeepChhabra @Mynda @Greg_Deckler 

  • Hi Anonymous ,

     

    A method, use the Top N filter type in Filter Pane to get the result you want. Please follow the steps.

    1 Drag the field [Short qty] to the filter pane, choose 'Top N', enter 3 after "Top" under the show items.

    2 Drag the [Short qty] again to the box under "By value", select "sum" or other aggregation you want via the arrow icon.

    Refer this screenshot.

    Result:

     

    Best Regards

    Community Support Team _ chenwu zhu

     

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

     

     

     

     

3 Replies

  • Anonymous , create rank like

    rankx(summarize(allselected(Table), Table[Product Name],Table[Plant],Table[Customer]), calculate(sum(Table[Short Qty])),,desc,dense)

     

    and use the visual level filter of rank <=3

  • Hi,

    I am not sure how your data mode looks like, but please check the below picture and the attached pbix file.

     

     

    Qty total: =
    SUM ( Data[Qty] )
    

     

    Qty top3: = 
    CALCULATE (
        [Qty total:],
        KEEPFILTERS ( TOPN ( 3, ALL ( Data ), [Qty total:], DESC ) )
    )
    
  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    A method, use the Top N filter type in Filter Pane to get the result you want. Please follow the steps.

    1 Drag the field [Short qty] to the filter pane, choose 'Top N', enter 3 after "Top" under the show items.

    2 Drag the [Short qty] again to the box under "By value", select "sum" or other aggregation you want via the arrow icon.

    Refer this screenshot.

    Result:

     

    Best Regards

    Community Support Team _ chenwu zhu

     

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