Forum

PowerPivot Date Col...
 
Notifications
Clear all

PowerPivot Date Column

5 Posts
2 Users
0 Reactions
77 Views
(@shantanu-krisgmail-com)
Posts: 12
Eminent Member
Topic starter
 

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.

 
Posted : 28/03/2019 5:04 am
(@mynda)
Posts: 4761
Member Admin
 

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

 
Posted : 28/03/2019 6:00 am
(@shantanu-krisgmail-com)
Posts: 12
Eminent Member
Topic starter
 

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?

 
Posted : 28/03/2019 8:25 am
(@shantanu-krisgmail-com)
Posts: 12
Eminent Member
Topic starter
 

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.

 
Posted : 28/03/2019 8:35 am
(@mynda)
Posts: 4761
Member Admin
 

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

 
Posted : 28/03/2019 7:05 pm
Share: