Forum Discussion

milindgupta's avatar
milindgupta
Regular Visitor
2 years ago
Solved

Top N Filter not working when Slicer value is selected.

I am building a dashboard where I have created a column chart to display Top 3 values (Refer Screenshot below). The column chart correctly shows Top 3 categories on default settings. I have few slice...
  • amitchandak's avatar
    2 years ago

    milindgupta , Seem like because of same value. Also, you should prefer to use measure then column.

     

    You can use a measure with a window function, and you can break ties easily

     

    example

    M1 =Sum('Table'[value])

    TOPN using window = Sumx(KEEPFILTERS(Window(1,ABS,3,ABS, ALLSELECTED('Table'[Study Institude]]),ORDERBY([M1],Desc))),[M1] )

     

    Break ties

     

    M1 =Sum('Table'[value])

    TOPN using window = Sumx(KEEPFILTERS(Window(1,ABS,3,ABS, ALLSELECTED('Table'[Study Institude]]),ORDERBY([M1],Desc, [Study Institude], asc))),[M1] )

     

    Learn Power BI: Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ