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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
baBI123
Helper II
Helper II

GROUP INTO MONTH

Hello POWER BI family, 

I have a question:  How can I group this chart (see attachment) so that the values on the x-axis are grouped by month?? 

Thanks in advanceEXAMPLE.png

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@baBI123,

If you create relationship between the SHOP WO TAT table and a calendar table  using date field, drag the date field of  the calendar table to X-axis of your chart, then you are able to get date hierachy and remove Year  & Quarter & Day as mehaboob557' s post.

Another method is to create a MonthName field in your SHOP WO TAT table using DAX below, then drag the MonthName field to X-Axis of your chart.

MonthName = SWITCH(MONTH('SHOP WO TAT'[Entry Date]),1,"January",2, "February",3,"March",4,"April", 5,"May",6,"June",7,"July",8,"August",9,"September",10,"October",11,"November",12,"December")



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Not sure if this has changed since this post, but for those looking, the correct way to do it now is:

  1. Go to the visulisation field where the date will be listed under the "Shared axis"
    image.png
  2. Click on the arrow on the right, then change from the name of your field (will be ticked) to "Date Hierarchy"
    image.png
  3. You should now have the options of year etc under your field, in this example I will label as year and month. Day can stay as its lower in the hierarchy, but get rid of Quater or it will get in the way, so click the x to remove it.
    image.png
  4. You will now see it sorted by year, to get it to month right click on the chart (anywhere on the chart that is blank) and choose "Expand to next level"
    image.png

You should now have your chart with year and month. Of course if its only one year you can remove the year where we removed the quater etc. Hope this helps anyone in future.

v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@baBI123,

If you create relationship between the SHOP WO TAT table and a calendar table  using date field, drag the date field of  the calendar table to X-axis of your chart, then you are able to get date hierachy and remove Year  & Quarter & Day as mehaboob557' s post.

Another method is to create a MonthName field in your SHOP WO TAT table using DAX below, then drag the MonthName field to X-Axis of your chart.

MonthName = SWITCH(MONTH('SHOP WO TAT'[Entry Date]),1,"January",2, "February",3,"March",4,"April", 5,"May",6,"June",7,"July",8,"August",9,"September",10,"October",11,"November",12,"December")



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mehaboob557
Resolver IV
Resolver IV

Hi,

 

You can do it my removing the year in the date heirarchi in the values section

 

2.PNG     =====>    1.PNG

 

This may help you to group in months

HI @mehaboob557 Unforunately, I don't have that option... any other ideas?EXAMPLE.png

Make sure your Entry Date column is set to datatype Date/Time

Hi @baBI123,

 

Can you share me the sample pbix file .

 

SO that i can check.

Unfortunately, I can't share this file with you @mehaboob557because it has private company information... Thank you for your help. It is still not working..Man Sad

@baBI123

Have you checked my methods? The two methods work in my environment.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

your second suggestion worked @v-yuezhe-msft one more question, how can I get them to go in order (ex: JAN, FEB, MARCH) ? Right now the month names are sorted in alphabetical order 😞 

Thanks!

Hi ,

I am just posting a ptocedure to sort irrespective of your table names.

Go to data (left hand side button) and click

Then go to the table to be sorted (right hand side)

You will need three columns in this calendar table for month
create

1 Main column (to set up the link column for Invoice Date)
CalendarInv = CALENDAR (MINX(Header, Header[Invoice Date]), today())
2 Column for month in text format
MonthT = FORMAT( CalendarInv[Date], "MMM")
3 Column for month in number format
MonthN = Month (CalendarInv[Date])

Then go to field list on the right hand side Click on MonthT

then go to modelling / sort by column and select MonthN
Reference : https://community.powerbi.com/t5/Desktop/Sorting-by-Month-as-Text-Jan-Feb-Mar-etc/td-p/9237

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.