Forum Discussion

gaikwadaa123's avatar
gaikwadaa123
Helper II
5 years ago

Sort Date and Value columns

Hello, 

I have a data that looks like below:

 

I would like sort the DEP, DEC and DOM column in descendig order for whatever the date range EST (Datetime )Column is selected. 

Example 

if I select date 1/1/2020 and 1/2/2020 for both the dates it should arange the DEP DEC and DOM values form Highest to lowest.

1/1/2020 high to low and 2/2/2020 high to low, 1/3/2020 high to low.

In current scenario If i try to order them in descending order it mixes the dates and hours by decending the values considering the full range of all dates.

 

I would like to see High to low for each date selection. 

Please suggest me the DAX or any solution based on the column names I have. Thank you.

 

 

 

5 Replies

  • edhans's avatar
    edhans
    Community Champion

    No DAX is needed for this. In your table in Power BI (I assume you are using a table visual - you didn't say) just select first by DEP. Then press SHIFT and sort again by DEC, then finally DOM. Now those 3 columns are sorted as you like. Changing what dates show up won't affect those sorts, just the records visible.

    If that isn't what you want, please be more specific. The image you show is from Power Query, and end users don't work in Power Query so sorting there will have no effect on a report.

    • gaikwadaa123's avatar
      gaikwadaa123
      Helper II

      Thank you for the response. 

      The solution you suggested sorts the whole data by mixing the dates. 

      I would like to get the data sorted in such way that it example. for today it will show high to low value and if I select another date it will show high to low value. so on. 

      what i do not want: when i select today and tomorrow it should not mix the hours of these two dates while sorting high to low. 

      Currently as per your suggestion it will show today today tommorow today tommorrow tommorow.....

      What I want Today High to low:

      Tommorwo high to low. 

      sort should be limited to that day only.

  • Hi gaikwadaa123 

    As per the my understanding of the scenario,
    You just need to right click on the columns and select the option of sort descending,it wll sort you data in desceding order.

    If this you dint meant just provide some more specific details about it.


    Thanks !

    • gaikwadaa123's avatar
      gaikwadaa123
      Helper II

      Thank you for the response. 

      I am not looking for the whole data sorting as such. 

       

      I am looking for  high to low limited to that day only. it should not mix up my dates while sorting the whole data. 

      example: Today: high to low

      Tomorrow: High to low

      not like take the whole today and tommorrow series and sort by both days. 

      Do you get what I am saying. Sort has to be limited for that day, for next day it should take 24 hours and sort them , for another day take 24 hours and sort them. 

      It should not take 48 hours and sort all 48...

      It should 24, 24 24 ,24 hours sorting limited to the day.