Microsoft Power BI: How to - Sorting your data by name of the month

Sorting your data by name of the month in Power BI

When making a query in Microsoft Power BI have you ever tried to pull a selection by month, only to find that it is not being sorted into month order? You might want to do this to compare year on year sales data for example or to make month by month comparisons. Seeing your data in the wrong order can be frustrating! Here we will show you how to arrange month data in sequential order so you can better understand trends and get access to the insights you require.

 

Why do I want to arrange my data by month in Power BI?

When your data is sorted into month order you can investigate and analyse it more easily revealing information likes seasonal sales trends and year on year patterns.

 

Potential issues when sorting data by month in Power BI

Month names are treated as text  so sorting will arrange them alphabetically

When you examine the dataset example shown here there are columns with month names which are text but if you look along the rows there is also a month number column. The field TheMonthNumber is what we want here.  To solve our problem we want to order the numbers sequentially. So select the ‘Month’ column and order it by the ‘Month Number’ column.

How to sort your data by name of the month : simple steps

First of all select the ‘Month’ column from the Data section on the right of the PowerBI report View

New options will appear in the main toolbar relating to the Month Field. This will include ‘Sort By Column’ 

Selecting the drop down will provide access to sort your Month field by a different field. In this case ordering Month by TheMonthNumber will ensure the Month’s will be in Order.

This should now solve your problem by organising your data in month order allowing you to visualise and understand your data better. Bringing your data to life through intelligent decision making!

 

Another common problem can be the sort direction.  What happens if you would like the Months to be in reverse order on your graph.  No problem!  Pressing the ... known as an Elipse on the graph reveals another menu allowing you to sort in Ascending or Descending order!

Switching to Descending order gives the opposite direction of sorting for your graph!

 

To find more pointers, short cuts and answers on how to solve your data queries in Power BI visit our 
How to – series on the blog page
 

Get the most from your Power BI - arrange your data and prepare for powerful  visualizations. PTR experts are always available for Power BI consultancy and Power BI training if you have any further questions.

 



We offer a blended consultancy and training approach to helping you with your Power BI Data Journey: Microsoft Azure BI Solutions TrainingData Strategy Consulting, Data Analytics Consulting, Power BI consulting and Microsoft Fabric Consulting and that’s just for starters. Please contact us for your bespoke training course.
 

Please contact info@ptr.co.uk to find out how we can help you. 
 

 

Share this post