Forum Discussion

queryguy48's avatar
queryguy48
New Member
1 year ago

PBI Won't Sort My Data like the Table View

Hello,

 

I am building a report and having trouble with one of my tables on the report view.  When I switch to Table view, the sort order is correct, but it is completely different on the report.  The data shows a count of how many people worked for each year category.  So the table view looks like this:
Length of Service    Count
1 years                      5  

2 years                      3

3 years                      1

4 years                      1

5 years                       2 

 

And so on... But the report shows this way
Length of Service    Count

1 year 

4 year

 

After 10 years, then it shows 2 year.  It sorts on the first value.  I don't want it to sort at all.  I just want it to display in the same order as the Excel data file.  Can anyone help?  

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    queryguy48 Maybe add an Index column and use a Sort By column for Length of Service referring to the Index column. Then it should sort in the order in which it comes in from the Excel file. If an Index column does not work because you have duplicates 1 years -> 1, 1 years -> 24, then you would add a conditional column where you would map 1 years to 1, 2 years to 2, 3 years to 3, etc. and then use that as your Sort By column.

    • queryguy48's avatar
      queryguy48
      New Member

      Thanks Greg!  This got me really close to fixing the issue.  However, the table view will only sort by my index column if I include the index column in the table.  I'm trying to find a way to hide the Index column.  

  • ajohnso2's avatar
    ajohnso2
    Icon for Solution Supplier rankSolution Supplier

    create a new column in your table where you only show the numeric value from Length of service e.g. 1, 2, 3, 4 etc and not 1 year, 2 year) then within your data view tab set the sort by order of Length of service column to that of your new column. 

    In your table visual click the 3 dots in the top right and ensure the sort order is based on length of service.