Forum Discussion

ericbi's avatar
ericbi
Frequent Visitor
8 years ago
Solved

How to sort weeknumber in row?

Hi, 

 

I have table like this 


I would like to have a visualization table like this and the top row sorted by weeknum descending. but BI always sort it ascending. I checked lot of topic but can't find a solution.  the weeknum is in whole number format. 



Thank you. 

  • ericbi's avatar
    ericbi
    8 years ago

    I found that I can sort it in the report after I submitted to the web.  just go to that visualization at right corner and select sort by weeknumber then done.  it's not working in desktop. 

     

    thank you everyone. 

6 Replies

  • Hey ericbi!

     

    I put your data into an Excel sheet--not power pivot. I then imported the excel sheet into power bi. I then created a matrix with the info, and it appeared as follows by default:

     

     

     

     

     

     

     

     

     

     

    Click HERE if you need to access my .pbix file. 

    • ericbi's avatar
      ericbi
      Frequent Visitor

      Hi, 

       

      I would like to have the 201803 in the first column, then 201802... etc.  

      • Anonymous's avatar
        Anonymous
        Not applicable

        ericbi,

        Please follow the steps below.

        1. Create a conditional column in Query Editor of Power BI Desktop.


        2. In report view of Power BI Desktop, click the Week column in your tables, then choose "Sort by column" to sort the Week column by the Custom column(conditional column).


        Regards,
        Lydia