How to Show Month and Year in Power BI Graph
Displaying both the month and the year on a Power BI chart axis should be simple, but it can be surprisingly tricky. You’ll often find your chart grouping all the "Januarys" together, regardless of the year, which completely muddles your time-series data. This article will walk you through several clear, step-by-step methods to get your axis formatted exactly how you want it, showing labels like "Jan 2023", "Feb 2023", and so on.
Understanding Power BI's Automatic Date Hierarchy
Before we fix the problem, it helps to understand why it happens. When you drag a date field onto a chart's axis in Power BI, it automatically creates a date hierarchy. This hierarchy consists of Year, Quarter, Month, and Day.
This is useful for drilling up and down through your data, but it's also the source of our formatting issue. If you use only the "Month" part of the hierarchy, Power BI's logic is to group all data for that month name together. So, sales from January 2022, January 2023, and January 2024 are all aggregated into a single "January" point. This is helpful for seasonal analysis (e.g., comparing holiday performance year over year) but not for viewing a continuous chronological trend.
The key to solving our problem is to override this default behavior and tell Power BI exactly how we want to display our date values.
Method 1: The Quick Fix Using the Existing Hierarchy
The simplest way to show month and year together is by using the built-in hierarchy, but adjusting what you display. This method doesn't create a perfectly combined "Jan 2023" label, but it accurately separates the months chronologically across years.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Step-by-Step Instructions:
- Drag your date field onto the X-axis of your visual (like a line chart or bar chart).
- In the "Visualizations" pane, look at the field you just added to the X-axis. You’ll likely see it listed as a "Date Hierarchy" with Year, Quarter, Month, and Day nested underneath.
- Simply click the "X" next to "Quarter" and "Day" to remove them from the visual. Now, you’ll only have Year and Month left.
Your chart will initially display the data at the Year level. To see the months, you need to "drill down." Find the drill-down arrows at the top right of your chart visual. Click the pitchfork-looking icon (its hover text says "Expand all down one level in the hierarchy").
Your axis will now show the Year and, on a separate line below it, the Months in chronological order (e.g., 2022 followed by its months, then 2023 followed by its months). While this is functionally correct, it can look a bit clunky and takes up more space. For a cleaner, single-line label like "Jan 2023", you’ll need a custom column.
Method 2: Create a Custom "Month-Year" Column with DAX
This is the most common and powerful solution. By creating a new column in your data model using DAX (Data Analysis Expressions), you gain complete control over how your date label looks. You'll create a new column specifically for the format "MMM YYYY".
Step 1: Create the Formatted Column
First, we need to add a new column to our date table that combines the month name and the year.
- Navigate to the Data View in Power BI (the icon that looks like a table on the left-hand navigation bar).
- Select the table that contains your date column (ideally, you have a dedicated Date Table).
- From the "Table tools" or "Column tools" ribbon at the top, click New Column.
- Enter the following DAX formula into the formula bar. Be sure to replace
'DateTable'[Date]with the actual name of your table and date column:
MonthYear = FORMAT('DateTable'[Date], "mmm yyyy")
This formula tells Power BI to take the value from each row in your date column and format it as a text string. Here's a quick breakdown of the format text:
mmm: Gives you the three-letter abbreviation for the month (Jan, Feb, Mar).yyyy: Gives you the four-digit year (2023).
After you press Enter, you'll see a new column filled with labels like "Jan 2023", "Feb 2023", etc.
Step 2: The Critical Sort-by-Column Step
If you use your new "MonthYear" column on a chart right now, you'll face another common problem: Power BI will sort it alphabetically (April 2023, August 2023, December 2022...). This happens because your new column is a text data type, not a date.
To fix this, you need to create a second helper column that can be sorted chronologically, and then tell Power BI to use it to sort our "MonthYear" column.
- While still in the Data View, create another new column. Let's call this one "MonthYearSort".
- Enter the following DAX formula:
MonthYearSort = FORMAT('DateTable'[Date], "yyyymm")
This formula creates values like "202301", "202302", "202303". Since these values are treated as numbers (or as text that sorts numerically), they will always sort in the correct chronological order.
- Now, click to select your first custom column (the "MonthYear" column).
- Go to the Column tools tab in the ribbon.
- Click the Sort by column button.
- From the dropdown menu that appears, select your new helper column: MonthYearSort.
It might not look like anything happened, but you’ve just told Power BI that whenever it sees the "MonthYear" column, it should use the "MonthYearSort" column to determine the display order.
Step 3: Use Your New Column in a Chart
Now for the payoff. Return to the Report View.
- Select your chart.
- Remove the original date field from the X-axis.
- Find your new MonthYear column in the Fields list and drag it onto the X-axis well.
Your chart's axis will now display clean, correctly-sorted labels like "Jan 2023", "Feb 2023", "Mar 2023", and on. Success!
Method 3: Creating Custom Columns in Power Query
If you prefer to handle data transformations before they are loaded into your model, you can create these same columns in the Power Query Editor. This is often considered a best practice for keeping your DAX model cleaner.
Step-by-Step Instructions:
- From the "Home" ribbon, click on Transform data to open the Power Query Editor.
- In the Queries pane on the left, select your date query.
- Navigate to the Add Column tab in the ribbon.
- Click on Custom Column. A dialog box will appear.
- For the "New column name", enter MonthYear.
- In the "Custom column formula" box, enter the following M formula. Remember to replace
[Date]with your actual date column name:
Date.ToText([Date], "MMM yyyy")
- Click "OK." You've just created your formatted text column. Now, let's create the sort column.
- Click Custom Column again.
- For the "New column name", enter MonthYearSort.
- For the formula, enter:
Date.ToText([Date], "yyyyMM")
- Click "OK."
- Ensure both new columns are set to an appropriate data type (Text for the display column, Whole Number or Text for the sort column).
- In the "Home" ribbon, click Close & Apply.
Once the changes are applied, you still need to follow Step 2 from Method 2 (The Critical Sort-by-Column Step) in the main Power BI window. The sorting instruction must be set in the DAX data model, even if the columns themselves were created in Power Query.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Final Formatting Tips
Even with the right column, the axis might still look cramped. Here are a couple of settings to adjust for a polished look:
Change Axis Type
Make sure your X-axis is set to "Categorical" instead of "Continuous." Using your new text column usually forces this change automatically. Select your visual, go to the Format your visual pane, expand X-axis, and check the "Type" dropdown.
Avoid Label Overlap
If you have many data points, the labels might overlap. In the X-axis formatting options, you can:
- Decrease the font size under "Values".
- Rotate the labels by adjusting the "Labels rotation" slider.
- Increase the "Minimum category width" to give each label more space, which may introduce a scrollbar - a good trade-off for readability.
Final Thoughts
Getting your Power BI charts to show a clean, chronological month and year format is essential for clear reporting. While you can quickly adjust the built-in date hierarchy for a basic view, creating a custom column with DAX or Power Query gives you precise control. The most crucial part of that process is creating a companion sort column to ensure everything lines up chronologically, not alphabetically.
Of course, all this manual column creation, DAX writing, and sorting is the kind of busy work that can slow you down when you just need a quick answer. Our tool was built to eliminate this exact type of friction. You don't have to learn DAX, know the intricacies of sorting, or deal with tricky axis formatting. We believe in getting answers fast, so we built Graphed , where you can connect your data sources and use simple language like, "Show me sales as a bar chart by both month and year" - it handles all the formatting behind the scenes to give you a perfectly visualized live report in seconds.
Related Articles
Facebook Ads for Pest Control: The Complete 2026 Strategy Guide
Learn how to run effective Facebook ads for pest control companies in 2026. This comprehensive guide covers campaign setup, targeting strategies, cost benchmarks, and best practices for generating quality leads.
Facebook Ads for Carpet Cleaners: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for carpet cleaning businesses in 2026. Get proven strategies for targeting, creative formats, retargeting, and budget that actually convert.
Facebook Ads For Personal Trainers: The Complete 2026 Strategy Guide
Learn how to effectively use Facebook ads for personal trainers in 2026. This comprehensive guide covers targeting strategies, ad creative, budgeting, and optimization techniques to help you grow your training business.