Forum Discussion

bilalkhokar73's avatar
bilalkhokar73
Helper IV
4 years ago
Solved

Transaction date Sorting Desc to Asc In Matrix

I have Date column in Date table, I want that Latest ddate shoudl come firts and then followed by other dates
Let's say today is  17June2022 then 17june, 16 juen it should come like this in Power BI MATRIX

Resolution treid -In power query Created a column index column from 1 and made sorting by That Index column , after clsoing power query editor and checked Matrix but dates still shwoing old to new sorting 

 

2. 

 

3. 


need help on this AmitK 

  • Hi bilalkhokar73

     

    Delete your index and try this method instead.

     

    In Power Query duplicate Date column and call it DateRevSort

     

    Add a new custom column

    DateRevSorter = Number.From([DateRevSort]) * -1

    then change the format to a whole number

     

    Then go into Modelling and click on the DateRevSort column, sort by DateRevSorter.

     

    Thed hide the DateRevSorter field.

     

    When you drag Date to a visual it will sort by Date

    but when you DateRevSort to a visual it will sort by reverse Date i.e. most recent first !

     

    Thanks for reaching out for help.

    I have helped you, now please help me by giving kudos.

    Remeber we are unpaid volunteers.

    Click the thumbs up and accept as solution button. 

    One question per ticket please. If you need to extend your request then please raise a new ticket.

    You will get a quicker response and each volnteer solver will get the kudos they deserve. Thank you !

     

     

     

     

7 Replies

  • Hi bilalkhokar73

     

    Delete your index and try this method instead.

     

    In Power Query duplicate Date column and call it DateRevSort

     

    Add a new custom column

    DateRevSorter = Number.From([DateRevSort]) * -1

    then change the format to a whole number

     

    Then go into Modelling and click on the DateRevSort column, sort by DateRevSorter.

     

    Thed hide the DateRevSorter field.

     

    When you drag Date to a visual it will sort by Date

    but when you DateRevSort to a visual it will sort by reverse Date i.e. most recent first !

     

    Thanks for reaching out for help.

    I have helped you, now please help me by giving kudos.

    Remeber we are unpaid volunteers.

    Click the thumbs up and accept as solution button. 

    One question per ticket please. If you need to extend your request then please raise a new ticket.

    You will get a quicker response and each volnteer solver will get the kudos they deserve. Thank you !

     

     

     

     

  • Please read the instructions please ... ğŸ˜€ğŸ˜€ğŸ˜€

     

    In Power Query duplicate Date column and call it DateRevSort

     

    Add a new custom column called DateRevSorter

    = Number.From([DateRevSort]) * -1

    then change the format to a whole number

     

    Then go into Modelling and click on the DateRevSort column, sort by DateRevSorter.

     

    Thed hide the DateRevSorter field.

     

    When you drag Date to a visual it will sort by Date

    but when you DateRevSort to a visual it will sort by reverse Date i.e. most recent first ! 

  • Hi bilalkhokar73 

     

    I am a volunteer and should not have to explain 3 times how to do the same thing  ğŸ˜€ğŸ˜€ğŸ˜€

    Sorting the Power Query will not change the sort sequence of reports.

    You need to config the column sort behavior in modelling.

     

    You have not changed DateRevSorter to a Whole Number.  It it still showing as a ABC123 data type.

     

    Also you have sorted the column in Power Query. Dont do that !

    Go into Modelling and click on the DateRevSort column, sort by DateRevSorter.

    When you drag Date to a visual it will sort by Date

    but when you DateRevSort to a visual it will sort by reverse Date i.e. most recent first .

    Ignore how the data is sorted in Power Query and look at the reports!

     

     

       

    😀

  • Thanks for accepting the solution.  Glad you learnt how to do it ok. Well done !