Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kman42
Helper III
Helper III

Bar chart starts with wrong month

I have a simple bar chart displaying counts by month. It is filtered by relative dates "is in the next 1 year," but it starts with January instead of October (today). Any suggestions?

 

Screen Shot 2019-10-22 at 9.09.19 PM.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The easiest way to solve is, in your Date table, create a column "Month Year" or something like that that has the Month and the Year.  Then use that field in your bar chart.  

You'll also need to create a MonthYearSort column that will get the Month Year column sorted properly (use the Sort By Column feature).

 

Here's the DAX:
MonthYear = FORMAT('Date'[Date], "MMM yyyy")

MonthYearSort = FORMAT('Date'[Date], "yyyyMM")

 

Eric

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

First, use the month year and check. Is sorting working?

Also is this column created by you or generated by power bi hierarchy?

 

I made the date table. It consists of a column of unique dates representing the underlying data table and then columns for the corresponding day, month and year.

Screen Shot 2019-10-23 at 8.53.18 AM.png

 

 

I am using the Date column in the bar chart. I've tried using it as both the date hierarchy and just the date and various combinations of the month and month and year in the date hierarchy. If I set it as date instead of date hierarchy, I can get close. The bar chart now starts at the right time, but it splits the months into two bars. Maybe I can fix that with some formatting help.

 

Screen Shot 2019-10-23 at 8.56.04 AM.png

Anonymous
Not applicable

The easiest way to solve is, in your Date table, create a column "Month Year" or something like that that has the Month and the Year.  Then use that field in your bar chart.  

You'll also need to create a MonthYearSort column that will get the Month Year column sorted properly (use the Sort By Column feature).

 

Here's the DAX:
MonthYear = FORMAT('Date'[Date], "MMM yyyy")

MonthYearSort = FORMAT('Date'[Date], "yyyyMM")

 

Eric

 

venal
Memorable Member
Memorable Member

@kman42 

Can you please share us the PBIX file with the sample data with the current and expected results.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.