Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Sort On base of filter selection

Hi Phil,

If I have an dynamic X axis say If i select Daily its should chnage to Day level, Monthly then Month Level. So far it works fine if I am on daily but moment I click on weekly the month names are sorted alphabatically. So I cerated another small table to sort with Month Names and their Ids as 1,2,3, for Jan, Feb, Mar and so on and put sorting on Month ID but still not working.

 

My X Axis formula is like 

SortedXAxis = if(Period[SelectedPeriod]="Monthly",InventoryReporting[MonthName],if(Period[SelectedPeriod]="Weekly",format(InventoryReporting[WEEK_END_DATE],"MM/DD/YYYY"),format(InventoryReporting[Snapshot Date],"MM/DD/YYYY")))

 

where when I click on Monthly in filter below it gives me data but MOnth Name is sorted alphabatically as below whiel I want to sort it by its sequence. This is bit different than usual

 

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

     

    If you create a custom sorting table and set up 'sort by column' property, you need to create relationship to original table and use this custom table column to replace original column to create visualization to apply custom sort effect.

     

    BTW, it will be help if you share some sample data or pbix file.

     

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      I did the same way what you explaining, created a Moth table with below and using Month from below table whichis sorted on ID. But still when I select Monthly it sorts on base of alphabets and not ID.

       

       

       

      But as my SortedXaxis column is based on Filter selection , it may not be working.

       

      Kindly sugget

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous,

         

        Can you please share some same data or pbix file for test?

         

        Regards,

        Xiaoxin Sheng