Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago

Sorting by Month as Text (Jan Feb Mar etc)

 

I notice in the Power BI Service we still can't sort a chart by another field.

 

This is annoying.  A workaround I found is to add a calculated column with a period as prefix to the month. 

 

=FORMAT([Period],"00")&"-"&[MonthName]

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Go to Power BI Desktop

    If you don't already have a month number column, add one.

    Select the column containing the month names

    Select Modeling tab > Sort By Column and from dropdown select the column that has the month numbers.

    Now when you publish to PBI Service, sorting will work correctly.

     

    HTH,

    Michele

     

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Quick update on this.  I found a column property setting in Analysis Services tabular enables me to specify a sort column.

     

    With Power BI Desktop the charts automatically sorted using this property.  

     

    I'm just waiting for model changes to be pushed to the service to see if the online chart sorts.

     

     

    • kcantor's avatar
      kcantor
      Community Champion

      You should be able to use another column to sort by.  It is hidden in the column properties. You select sort by, then choose another column. I have, in the past, used the month number column to sort my month name column.