Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a month year column from Jan 2018 - July 2019.
Month Year
Jan 2018
Feb 2018
Mar 2018
.
.
Jul 2019.
Usually when i want to sort this in the same order as above in an import query, I just create a custom column : Table[Year]*100 + [Month Number] and then sort month year with this column.
However, not sure why maybe because now it is a DIRECT QUERY, i am not able to use the above logic to sort it. IT just throws an error. Any idea how to sort it now? Thanks!
hi, @Anonymous
Here is a similar thread for your reference:
Sorting a text column using Direct Query
Best Regards,
Lin
@v-lili6-msft Hey thought about that but I cannot hard code the value through switch statement as it is a month year column. if i say when jan 2018 , then 1 and so on.. every month there is a new month year and i would have to keep adding it to my switch statement.
HI, @Anonymous
You could use Contains in the formula to get Month No column, and then use Split to get Year column.
Then you could get Year month by the same logic in Edit Queries.
Best Regards,
Lin
@v-lili6-msft But in this case would it not give all jan's = 1. Then my axis would be:
jan 2018 jan 2019 .. feb 2018 feb 2019.......
But i would like it to be .. jan 2018 feb 2018 ..... jan 2019 feb 2019
@Anonymous unfotunately you cannot do this, here it says about modelling limitatons (also listed below)
The term modeling in this context means the act of refining and enriching the raw data, as part of authoring a report using it. Examples include:
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |