Forum Discussion
baBI123
8 years agoHelper 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 advance
- Anonymous8 years ago
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
baBI123
8 years agoHelper II
your second suggestion worked Anonymous 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!
mehaboob557
8 years agoResolver III
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
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