Forum Discussion

Tempus-Tommy's avatar
Tempus-Tommy
New Member
6 years ago

Sorting Table with 2 Datasets

Hi,

 

Having trouble sorting the rows in a Table visual with 2 Datasets (related by Dataset1.Field1=Dataset2.Field1).

What I want to do is to sort first on Dataset1.Field2 and then on Dataset2.Field3, any ideas?

6 Replies

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Tempus-Tommy ,

    From your description, it seems that you want sort first on Dataset1.Field2 and then on Dataset2.Field3? If it is, You may refer to the post below

    https://community.powerbi.com/t5/Desktop/Sorting-a-table-using-multiple-columns/td-p/447941

    If it is not your case, please describe some detail for your problem and show some screenshoots about your issue, so that we can help further investigate on it.

    Best Regards,

    Liang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Tempus-Tommy's avatar
      Tempus-Tommy
      New Member

      Hi V-lian-msft,

       

      Thank you so much for replying on my issue. I think you get the problem correctly but the post you refer to is for sorting on multiple columns inside the same dataset/table.

      I have Dataset1 with some Employee-data and Dataset2 with som Sales-data and a Date-column. But, Dataset2 do not contain the Employee-number so there is a relationship between theese 2 datasets.

      Into a Table visual I drag the Dataset1.EmployeeID, Dataset2.Date and Dataset2.SalesAmount, and would like that the sorting of the rows in this Table visual is done first on Dataset1.EmployeeID and then on Dataset2.Date, but the sorting seems to be random. I have tried doing the sorting in the actual sql getting the data for each Dataset and also in Power Query. As long as I use 2 different Table visuals, one for each table the sorting is ok, but when I combine these into one Table visual it is messed up.