Forum Discussion

VK_nz's avatar
VK_nz
Helper I
1 year ago
Solved

Weeks group sorting

Hi all,

 

Appreciate hepl pointing in right direction.

I have blow matrix for each week - starting on Monday for multiple financial years (July to June).

How do I sort weeks Ascending to show most recent at the top? 

 

I have tried week no. and formating which does give me sorting but then it only shows week-1, week-2 and not the actul week group with start and end date as above table

 

File link: https://www.dropbox.com/scl/fi/akylh4hwb1gcqbiuqg5ig/ActivityAnalysis.pbix?rlkey=r4fvp8immzsscdlwx2y4tya7w&st=5dnjjwez&dl=0

 

  • VK_nz 

    You can follow this approach:

     

    I am attaching the PBIX file below

    Need a Power BI Consultation? Hire me on Upwork

     

     

     

    Connect on LinkedIn

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!


     

     

  • Hello VK_nz , 

     

    please try the below steps to get the week sort column by calculated column and sort the week group by this column..

     

    Step 1 - Create Week Sort Column and make sure you make the data type as whole number.

     

     

    Step 2 - Sort the Week group column by "Week Sort" Column which you created.

     

    Now you view the Week group sorted in the Visual..

     

     

    There a much easier way to do in Power query but the above approch also works fine..

     

    If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

     

8 Replies

  • VK_nz 

    You can follow this approach:

     

    I am attaching the PBIX file below

    Need a Power BI Consultation? Hire me on Upwork

     

     

     

    Connect on LinkedIn

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!


     

     

    • VK_nz's avatar
      VK_nz
      Helper I

      Thank you Rita, I have copied dropbox link for the calendar file. Appreciate your help.

      While I have created week group with start date and end date of the week, I just cant get to sort it chronologically.

      • dharmendars007's avatar
        dharmendars007
        Memorable Member

        Hello VK_nz , 

         

        please try the below steps to get the week sort column by calculated column and sort the week group by this column..

         

        Step 1 - Create Week Sort Column and make sure you make the data type as whole number.

         

         

        Step 2 - Sort the Week group column by "Week Sort" Column which you created.

         

        Now you view the Week group sorted in the Visual..

         

         

        There a much easier way to do in Power query but the above approch also works fine..

         

        If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

         

        Thank You

        Dharmendar S

        LinkedIN 

         

  • Found solution by adding 

    Week Start date = 'Calendar'[Date].[Date]+-1*WEEKDAY('Calendar'[Date].[Date],2)+1
    as sorting column to week group
  • tharunkumarRTK  I got value for current week and want to plot previous week value side by side i.e. week 09/09 should have 78 in previous week column value :