Forum Discussion

cst_dev32's avatar
cst_dev32
Frequent Visitor
7 years ago
Solved

Display TOP N by Count base on 1 Field

Hy guys, i have an issue for my work I have 1 column named PLNT and I need to display top 5 from that column base on their count here's the data   And i filter by PLNT count   B...
  • venug20's avatar
    venug20
    7 years ago

    cst_dev32

     

    You can achive this in two ways

     

    1st way: which already provide in above...

     

    1.  go to menu bar select "Edit Queries"

    2.  go add column "index column" 

    3.  select "From 1" in index column

     

    like below

     

     

    2nd way: (If not available power query editor)

     

    1. create one column for count

     

    index = CALCULATE(COUNT('Rank'[Plant]), FILTER('Rank', 'Rank'[Plant] = EARLIER('Rank'[Plant])))

     

    2. create quick measure for running total

     

    index running total in Plant =
    CALCULATE(
    SUM('Rank'[index]),
    FILTER(
    ALLSELECTED('Rank'[Plant]),
    ISONORAFTER('Rank'[Plant], MAX('Rank'[Plant]), DESC)
    )
    )

     

    3. take "index running total in Plant" into visual filter chose <6

     

     

     

     

    if it is solution for your query, please accept as solution...