Forum Discussion
Sort Graph by Month and Year
Hi Jordan,
Actually, the X-axis I used in this graph is from a Date table using the combined fields of month and year.
InsertCalendarMonth = Table.AddColumn(InsertMonthName, "MonthInCalendar", each (try(Text.Range([MonthName],0,3)) otherwise [MonthName]) & " " & Number.ToText([Year])),
Can you walk me through on how I can create a new column with index as suggested above?
Thanks
Hi Polaris,
Okay, what source did you upload the data from? Excel?
- polaris30288 years agoHelper III
Hi Jordan - not sure what source of what data you're asking. The Date table was created in PowerBI itself (as a query). The data is coming from Google sheets.
So, basically I have two tables, one as datasource and a Date table for the calendar. The X-Axis presented in this graph that I wanted to sort out is using the concatenated Month and Year columns from the Date table. If I have to create a new column like what you said with Index, which table should I create it? and How?
Thanks
- JordanJSA8 years agoFrequent Visitor
Hi Polaris,
I've been looking into this and I'm not sure that this can be done within PowerBI. The index feature within PowerBI naturally orders the values 1,2,3.. Which wouldn't return the output you need. An alternative would be to create the index within Google docs if possible and then once loaded into PowerBI you would have the order that you require and you could sort by this value.
thanks