Forum Discussion
How to sort Month in Dynamic Change Axis ? Sorting Month name
- 8 years ago
Thanks a lot for helping me but For Dynamic change Axis Month to QTR / QTR to Month switch with sorting by Month name I have wrote below dax query:
DimTable =
ADDCOLUMNS(
UNION ( CROSSJOIN(DISTINCT('Month'[Month Period]), DATATABLE("AxisDimension", STRING, { {"Month"}}), DISTINCT(Quarter[Quarter Period])),
CROSSJOIN(DISTINCT('Month'[Month Period]),DATATABLE("AxisDimension", STRING,{ {"QTR"}}), DISTINCT('Quarter'[Quarter Period])))
,"AxisValue", SWITCH([AxisDimension], "QTR", FORMAT(Quarter[Quarter Period], "0000"),"Month", 'Month'[Month Period])
,"AxisSort", SWITCH([AxisDimension], "QTR", CONCATENATE( RIGHT(Quarter[Quarter Period],4), CONCATENATE("0", RIGHT(LEFT(Quarter[Quarter Period],2),1))) ,"Month", CONCATENATE( RIGHT('Month'[Month Period],4), SWITCH(LEFT('Month'[Month Period],3), "Jan", "01", "Feb", "02", "Mar", "03", "Apr", "04", "May", "05", "Jun", "06", "Jul", "07", "Aug", "08", "Sep", "09", "Oct", "10", "Nov", "11", "Dec", "12")))
)
can you please share the file with this please and how you create a ID
Hi mdaamirkhan,
I made the ID by hand in excel and used the option "Enter data" where I just pasted the below data. If you paste it the "Month" and "ID" will automatically be promoted to column headers.
| Month | ID |
| Jan-15 | 2015-01 |
| Feb-15 | 2015-02 |
| Mar-15 | 2015-03 |
| Apr-15 | 2015-04 |
| May-15 | 2015-05 |
| Jun-15 | 2015-06 |
| Jul-15 | 2015-07 |
| Aug-15 | 2015-08 |
| Sep-15 | 2015-09 |
| Oct-15 | 2015-10 |
| Nov-15 | 2015-11 |
| Dec-15 | 2015-12 |
| Jan-16 | 2016-01 |
| Feb-16 | 2016-02 |
| Mar-16 | 2016-03 |
| Apr-16 | 2016-04 |
| May-16 | 2016-05 |
| Jun-16 | 2016-06 |
| Jul-16 | 2016-07 |
| Aug-16 | 2016-08 |
| Sep-16 | 2016-09 |
| Oct-16 | 2016-10 |
| Nov-16 | 2016-11 |
| Dec-16 | 2016-12 |
| Jan-17 | 2017-01 |
| Feb-17 | 2017-02 |
| Mar-17 | 2017-03 |
| Apr-17 | 2017-04 |
| May-17 | 2017-05 |
| Jun-17 | 2017-06 |
| Jul-17 | 2017-07 |
| Aug-17 | 2017-08 |
| Sep-17 | 2017-09 |
| Oct-17 | 2017-10 |
| Nov-17 | 2017-11 |
| Dec-17 | 2017-12 |
(it is important that the column "ID" is in Text format not in Date format !)
Regards,
L.Meijdam
- mdaamirkhan8 years agoPost Prodigy
can you share the pbix
- Anonymous8 years agoNot applicable
Hi mdaamirkhan,
I am afraid I cannot but what do you need it for, you have all the information you need ? Is there something you don't understand ?
Regards,
L.Meijdam
- mdaamirkhan8 years agoPost Prodigy
Its not working that why I need help if you do on my pbix file and share with me then it will be easy to understand. Kindly please me.
- Anonymous8 years agoNot applicable
Hi mdaamirkhan,
If the only thing you can say is "Please do it for me on my PBIX" I am afraid I can't help you.
Have a good day,
L.Meijdam
- mdaamirkhan8 years agoPost Prodigy
ok send the qery where I will create tell me the steps and you are also only sharing the screenshot and you are not saying the steps with query like other people do