Forum Discussion

Qasim_Jan's avatar
Qasim_Jan
Frequent Visitor
2 years ago
Solved

Keep Original Sort Order Of A Column Table.

Hello Power BI community, I am currently facing an issue while trying to create a pivot table in Power Query with unpivoted data. Specifically, I have three columns: EmployeeName, Year, and Count, i...
  • BA_Pete's avatar
    2 years ago

    Hi Qasim_Jan ,

     

    Before you perform your pivot step in Power Query, go to the Add Column tab > Index Column > From 1. This will index your table in the current sort order.

    After you pivot , you can then sort by the index column and year to get the data in the exact order you want.

     

    Pete