How to Get Month Name from Date in Power BI
Ever tried to create a report in Power BI that shows performance by month, only to have your chart look like a jumbled, alphabetized mess? You’re not alone. Turning a standard date column into a readable month name like "January" is a fundamental step for creating clean, insightful reports, but it comes with a few common stumbling blocks. This guide will walk you through several easy ways to get the month name from a date in Power BI and, most importantly, how to sort it correctly.
Why Extracting the Month Name Is So Important
Before jumping into the "how," let's quickly touch on the "why." Your raw data likely contains a specific date, like "2023-11-15". While this is precise, it's not very useful for trend analysis. Analyzing data day-by-day is too noisy, and looking at it year-by-year is too broad. The month-level view is often just right.
By extracting the month name, you can:
- Visualize Monthly Trends: Easily create bar charts or line graphs to see if sales are growing, if website traffic peaks during certain seasons, or if marketing campaign performance is improving month-over-month.
- Simplify Your Reports: A column showing "January," "February," and "March" is far more intuitive for your audience than columns of full dates. It makes your dashboards and reports easier to read at a glance.
- Group and Summarize Data: Month names allow you to aggregate your data effectively. You can quickly calculate total revenue for May, average leads generated in September, or total ad spend for December across multiple years.
In short, it’s a small transformation that makes your data immensely more powerful for analysis.
Method 1: The Quick and Easy Way with Power Query
If you prefer to transform your data as you load it into Power BI, Power Query is your best friend. It’s often the most straightforward way to add month name and number columns without writing any formulas.
Power Query is the data transformation engine in Power BI. Think of it as the place where you clean and prepare your data before it gets to the main report builder.
Here’s how to do it step-by-step:
Step 1: Open the Power Query Editor
From your main report screen, go to the Home tab and click on Transform data. This will open the Power Query Editor in a new window.
Step 2: Select Your Date Column
In the editor, find the table and the specific date column you want to work with (e.g., 'OrderDate'). Click on the column header to select it.
Step 3: Add the Month Name Column
With the date column selected, go to the Add Column tab in the ribbon at the top. From there, follow this path:
Date → Month → Name of Month
And that's it! Power BI will instantly add a new column to your table containing the full month name for each date. You can rename the column to something simple like "Month Name" by double-clicking the header.
Step 4: Add the Month Number Column (for Sorting)
As you'll see later, sorting months alphabetically is a common problem. To fix this, we need a helper column with the month number (1 for January, 2 for February, etc.). The process is almost identical to the last step.
Select your original date column again, then go to the Add Column tab:
Date → Month → Month
This will create another new column, this time showing the number of the month (1-12). Rename it to something like "Month Number."
Step 5: Close & Apply
Once you have both your "Month Name" and "Month Number" columns, click the Close & Apply button in the top-left corner of the Power Query Editor. This loads your newly transformed data back into your Power BI report.
Method 2: Getting More Flexible with DAX Formulas
Sometimes you need to add calculations after your data is already loaded. That's where DAX (Data Analysis Expressions) comes in. DAX is Power BI’s formula language, similar to Excel formulas but much more powerful. You use DAX to create new columns and measures directly in your data model.
The most common DAX function for this task is FORMAT.
Step 1: Go to the Data View
In your main Power BI window, click on the Data icon on the left-hand navigation pane (it looks like a small table).
Step 2: Create a New Column
Select the table you want to add the column to. Then, in the Column tools tab at the top, click on New column.
**Expert Tip:** For small, well-structured models, doing this in DAX is fine. But for large datasets, a golden rule is to push transformations as far upstream as possible. This means doing tasks like this in Power Query (or even your source database) is generally more efficient and performant. But DAX is perfect for quick additions or more complex, row-by-row logic.
Step 3: Write the DAX Formula for Month Name
A formula bar will appear at the top. Here, you'll define your new column using the FORMAT function. The syntax is:
FORMAT(<value>, <format_string>)To get the full month name (e.g., "January"), use this formula. Replace 'YourTable'[YourDateColumn] with the actual names of your table and date column.
Month Name = FORMAT('YourTable'[YourDateColumn], "MMMM")To get the abbreviated month name (e.g., "Jan"), use this formula instead:
Month Short Name = FORMAT('YourTable'[YourDateColumn], "MMM")Hit Enter, and your new column will be populated with the month names.
"MMMM"tells Power BI you want the full, written-out month name."MMM"tells Power BI you want the three-letter abbreviation.
Step 4: Create the Month Number Helper Column with DAX
Just like with Power Query, you'll need a month number column to sort everything correctly. Create another new column and use the MONTH function:
Month Number = MONTH('YourTable'[YourDateColumn])This function simply extracts the month number (1-12) from the date. Now you have everything you need for the final and most important step.
The Critical Final Step: How to Sort Months Chronologically
You've successfully created your month name column! You drag it onto a chart... and the months are out of order: April, August, December, February. What happened?
By default, Power BI sorts text columns alphabetically. It doesn’t automatically know that "February" should come after "January." This is easily the most common issue users face, but the fix is simple if you've already created your "Month Number" helper column.
Step 1: Select Your Month Name Column
In the Data view, find and click on the header of your text-based month name column (e.g., "Month Name"). This highlights the entire column.
Step 2: Use the "Sort by Column" Feature
With the "Month Name" column selected, a Column tools tab will appear in the top ribbon. In that tab, click the Sort by column button.
Step 3: Choose Your Number Column
From the dropdown menu that appears, select your helper column: "Month Number."
It might take a second, but you won’t see any immediate changes in the data table itself. However, behind the scenes, you’ve just told Power BI an important rule: whenever you use the "Month Name" column in a chart or visual, sort it according to the "Month Number" column, not alphabetically.
Now, when you return to your report view, any visuals using the "Month Name" field will automatically sort chronologically: January, February, March, and so on. Problem solved!
Final Thoughts
Mastering date transformations is a fundamental skill in Power BI that lets you build much clearer, more insightful reports. Whether you use the simple point-and-click interface of Power Query or the flexibility of a DAX formula with FORMAT, the key is to remember to create a numeric month column and use the "Sort by Column" feature to ensure your reports make logical sense.
Honestly though, spending hours clicking through menus, writing formulas like FORMAT([Date], "MMMM"), and debugging sorting issues is exactly the kind of manual work that slows down a modern team. At Graphed, we decided to eliminate that friction completely. Instead of building these columns, you can simply ask, "show me website traffic by month" in plain English. We handle the data connection, transformation, and visualization automatically, delivering a perfectly sorted chart in seconds, not hours.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.