Forum Discussion

Doby42's avatar
Doby42
Frequent Visitor
6 years ago
Solved

Top N filter is sorting whole number wrong

I'm confused as to why the "Top N" for the whole number field of yearnbr wouldn't pick the same order as sort order?  Any suggestions?
I worked around it by creating a rankx column for year, and then use that as the "by value".  But I don't think any work around should be nessary.

 

  • Doby42's avatar
    Doby42
    6 years ago

    Thanks for posting.  Looking at your pbix file I noticed that it was sum of year.  The issue is I'm using a date table that has far more than just year.  So my sum of yearnbr is causing the issue.  Being a leap year the total for 2016 is higher than 2017.

     

    Once I changed from sum to max value the sort order was correct.  

     

     

2 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi Doby42 ,

     

    Based on my test, the TOPN Filter works fine on my side, could you please reproduce this issue in my shared sample pbix file?

     

     


    BTW, pbix as attached.

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Doby42's avatar
      Doby42
      Frequent Visitor

      Thanks for posting.  Looking at your pbix file I noticed that it was sum of year.  The issue is I'm using a date table that has far more than just year.  So my sum of yearnbr is causing the issue.  Being a leap year the total for 2016 is higher than 2017.

       

      Once I changed from sum to max value the sort order was correct.