Hi,
My column is a dates column in ddmmyyyy format. I want to create a new column with only MMM-YYYY format so that my chart from the table does not show ddmmyyyy format axis labels.
How can i convert my ddmmyyyy format to mmm-yyyy format.
Hi Shantanu,
You can add a column to your data table with the DAX FORMAT function. It works just like the TEXT function in Excel.
e.g. =FORMAT([dates], "MMM-YYYY")
Mynda
Thanks Mynda- I figured out the way but it converts it into text & when i use that column in the chart - it doesnt remain a line chart, its like all Jans & Febs come together & i have manually drag the months.
While changing the format- can i not maintain in the date format?
Also- I am looking to create YTD attrition calculation. So if my year starts in April 2019 & i calculate YTD attrition in June- It should consider my start date to be April 2019 & take total no. of leavers from April till June-2019.
How do i create my DAX query for this. Once this is done - I want to do the same calculations for last year (2018- Same time) so that i can compare YTD this year with YTD last year. Basically for both my current year & last year- the time period for comparison should be same.
So if my YTD in Sept-2019 will be # of leavers from April 2019 to Sept 2019 & then i compare that figure with April 2018 to Sept 2018.
I hope my query is clear-Any help would be great - Thanks a lot.
Hi Shantanu,
You need to force months to be sorted based on a numeric column, rather than text. You do this by setting the 'Sort By'. This is covered in the Power Pivot course.
Please complete the course before trying to tackle things in your own model. The DAX question above should be covered in the course. Also, please start a new thread for new questions. This ensures topics are discoverable by others and topics stay 'on topic'.
Thanks,
Mynda