Forum Discussion
Sort Month Year Chronologically
hello and thank you in advance for any help offered.
I've searched through the forums and found a lot of solutions but none of them have worked. The ones I've tried are listed below
I am using DirectQuery data for my mode and I have created a DateKey table and created a relationship between that and my data table. The data is a view from SQL. In my DateKey table I have a column created as
YnMnAsInteger = (DateKey[Year])&FORMAT(DateKey[Date],"MM")
The relationship is between DOI_Date and MnYn = FORMAT(DateKey[Date],"MM")&"/" &DateKey[Year].
When I choose Sort by Column | YnMnAsInteger nothing changes.
I'm not sure what I'm missing.
Anonymous
In your table, Month-year should have been sorted or MonthyearInt or Sort column.
In YYYYMM format.
Also, the month year which uses in the report/visual should come from the same table as a sort column.
16 Replies
- amitchandak
Super User
Create a month sort column and mark it as sort column
- AnonymousNot applicable
amitchandak, I have a column setup already, MonthY. I added that to the Axis entry along with the DOI_Date from the data table and again nothing changed.
In the relationship screen there is a warning message, "This relationship has cardinality Many-Many. This should...." it won't let me change it. Could that be causing my issue?
David
- edhans
Community Champion
Yes. Avoid many-to-many unless you really need it. Bridge Tables generally work better for most use cases, and avoid problems M2M can cause.