How to Get Month Name from Date in Power BI DAX
Dealing with dates in Power BI can be tricky, especially when you need something as simple as the month name. While your date column might say "1/15/2024", your report needs to clearly show "January". This guide will walk you through the essential DAX functions to pull the month name from any date, fix common sorting problems, and build more reader-friendly reports.
Why Does Displaying the Month Name Matter?
In data reporting, clarity is everything. When you're building a dashboard for your team, clients, or leadership, presenting data in the most intuitive way possible is your main job. Asking your audience to translate numeric dates in their head adds unnecessary friction and slows down their a-ha moments.
Look at these two charts showing the exact same data:
Chart 1: With a standard date hierarchy
While technically correct, it's clunky for comparing monthly performance. The axis can get crowded, and the focus is on daily noise rather than the monthly trend.
Chart 2: Grouped by Month Name
This is much cleaner and easier to understand. The audience can immediately see the performance for "January," "February," etc., without needing to decipher date codes. It answers the question, "How did we do each month?" directly. This small change makes your reports more professional and actionable.
The Easy Way: Using the FORMAT Function
The most direct way to get a month's name is by using the FORMAT function in a calculated column. A calculated column computes a value for each row in your table and stores it, making it perfect for descriptive attributes like a month name that you'll use over and over in your charts and filters.
Let's say you have a table named Sales with a date column called [OrderDate]. Here's how you create a column for the month name.
First, navigate to the Data view in Power BI, select your table from the Data pane on the right, and then click New Column in the ribbon at the top.
Getting the Full Month Name (e.g., "January")
In the formula bar, type the following DAX expression:
Month Name = FORMAT([OrderDate], "MMMM")
Let's break this down:
- Month Name = This is simply the name of your new column.
- FORMAT() is a powerful DAX function that converts a value (like a date) into text according to a specific format.
- [OrderDate] is the existing date column you want to pull the month from.
- "MMMM" is the format code that tells Power BI, "Give me the full name of the month."
Once you hit Enter, a new column will appear in your table. For a row with an [OrderDate] of "7/22/2024," this formula will return "July."
Getting the Short Month Name (e.g., "Jan")
If you prefer a three-letter abbreviation for your months to save space, the process is nearly identical. You just need to change the format code slightly.
Month Name Short = FORMAT([OrderDate], "MMM")
The only difference here is "MMM", which tells DAX to return the abbreviated month name. A row with an [OrderDate] of "7/22/2024" will now return "Jul."
The Sorting Problem: Why Your Months Are in Alphabetical Order
You've created your beautiful new Month Name column and you build a visual, but something is wrong. Your chart shows April, August, December, February… it's all out of order! What gives?
By default, Power BI sorts text fields alphabetically. It doesn't inherently know that "February" should come after "January." This is one of the most common hiccups for newcomers, but thankfully, the fix is straightforward.
To fix this, you need to create another column that gives Power BI a numeric value to sort the month names by.
Step 1: Create a Month Number Helper Column
Just like you created the Month Name column, you'll create another new calculated column. This time, we'll use the MONTH function.
In the ribbon, click New Column and use this formula:
Month Number = MONTH([OrderDate])
The MONTH() function is simple: it looks at a date and returns a number from 1 (for January) to 12 (for December). Now you have a helper column that provides the correct chronological order.
Step 2: Use the 'Sort by Column' Feature
With your helper column ready, you can now tell Power BI how to correctly sort your month names.
- Make sure you're still in the Data view.
- Select the text-based month column you want to sort (e.g., your
Month Namecolumn). A border will appear around it to show it's active. - In the top ribbon, a Column tools tab will appear. Click on it.
- Find the Sort by column button and click the dropdown.
- From the list, select the numeric helper column you just created (
Month Number).
Nothing will visibly change in your data table, but Power BI now understands the correct order. Go back to your report view, and you'll see your visuals are now perfectly sorted: January, February, March, and so on. This fix works for both full and abbreviated month names.
Best Practice: Building a Dedicated Date Table
While creating calculated columns in your main data table works, a better long-term solution is to use a dedicated Date Table (also known as a Calendar Table). This is a master table in your data model that contains a single row for every day in your desired date range. You then connect this table to your other data tables (like Sales or Marketing) via their date fields.
Why do this?
- Efficiency and Organization: It centralizes all your date-related logic. Instead of adding several date columns to every single fact table in your model, you create them just once in your Date Table.
- Time Intelligence Functions: Advanced DAX functions for time-based comparisons — like
SAMEPERIODLASTYEARorDATESYTD— depend on a properly configured Date Table to work correctly. - Reusability: Your Date Table can be used to slice and dice any data in your report, regardless of its original source.
You can create a basic Date Table using a DAX CALENDARAUTO() or CALENDAR function. Once you have a single column of dates named [Date], you can add all the columns we just discussed:
Month Name = FORMAT('Date Table'[Date], "MMMM")
Month Name Short = FORMAT('Date Table'[Date], "MMM")
Month Number = MONTH('Date Table'[Date])
Year = YEAR('Date Table'[Date])
Quarter = FORMAT('Date Table'[Date], "\QQ")
Don't forget to use the Sort by column method on Month Name using Month Number. Then, relate your new Date Table to your Sales table by dragging the [Date] column onto your [OrderDate] column in the Model view.
Final Thoughts
Extracting the month name from a date in Power BI is a fundamental step toward building clear, insightful reports. The FORMAT function gives you the text you need, and a simple MONTH helper column paired with the 'Sort by Column' feature ensures your data is always presented in the correct chronological order.
Manually shaping your data and writing DAX formulas in tools like Power BI is a valuable skill, but it often takes you away from the actual goal: getting quick answers to business questions. We built Graphed to bridge that gap. You connect your marketing and sales platforms, then simply ask questions like, "Compare my ad spend versus revenue by month for Q2." Our AI automatically builds the visualizations and interactive dashboards for you in seconds, no formulas required.
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.