Forum Discussion

justlogmein's avatar
justlogmein
Icon for Helper III rankHelper III
4 years ago

Power Query column sort not propogating to the tables

I am trying to sort my data and I have heard all the transforming is supposed to be done in Power Query. But it's like Power Query and the normal tables within Power BI (whatever you call it, in Excel I would call it PowerPivot) are not talking to each other. How do I sort tables?

 

You can clearly see I have sorted the columns in PQ and they are not the same in order in the main table.

 

https://jmservicescomau-my.sharepoint.com/:u:/g/personal/jacob_jmservices_com_au/EbBvWF5xkjlHuPDaUZYEn04BCfn0GSufqWH-o2Mxksr3jQ?e=jX8Kkg 

3 Replies

  • Power BI visuals display columns in alpha/numeric sequence  NOT by how data is sorted in Power Query.
     
    For example month names will ABC sort as April, Feb, Jan,, June, March, May.
     
    However you can add an extra month number in Power Query (1 to 12).
     
    Then click on the Modelling tab, click on Month Name and Sort by Month Number.
     
    The Month Name will then sort by Jan, Feb, Mar, April etc on visuals.
     
    Please click thumbs up and accept as solution buttons. Thanks.
     
     
  • Column re-ordering has never been respected in Data View. Columns are in the order they were in the first time that you loaded the table; and any columns added after the first load appear after previously loaded columns.

     

    If you want the column order to mimic power query, disable load and apply (making your table disappear, along with any relationships). Then enable load again and apply.

  • LRSF's avatar
    LRSF
    Regular Visitor

    Dear All

    With due respect to message 3, I attempted to do this and did not get the desired result... perhaps I did not carry out the process correctly. Nevertheless, unloading, re-loading and re-establishing relationships is not ideal.

    I did however manage to achieve the result (sorting by more than one column in data view) by creating the required sort order in Power Query then adding an index to the correctly sorted data and then, as the data is sorted differently when loaded to the data view, sorting by index in the data view.

    Hope this helps, thank you.