Forum Discussion

hackfifi's avatar
hackfifi
Helper V
9 years ago

Date Hierarchy Format in Column Chart

I am currently using Date Hierarchy, and the format for YEAR & MONTH is "2017 January, 2017 February........2018 December"

Is there any way to truncate this format to "2017 Jan, 2017 Feb" OR "Jan 17, Feb 17....Dec 18"

I need the Date Hierarchy function to DRILL UP & DOWN, but i cant seem to change the format.

Kindly Advise.

Thanks!

 Drip UPDrill DOWN

 

5 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Hi there,

     

    You can use the FORMAT fuction in DAX to create new columns in your date/calendar table.

     

    Perhaps use the following code to create a new calculated column

     

    Year and Month = FORMAT([date col], "YYYY MMM") 

     

     

    • hackfifi's avatar
      hackfifi
      Helper V

       

       

       

       

       Thanks Phil_Seamark - Please see update above. I seem to have lost the capability to Drill up & Down - also, the dates do not seem to be sorted in order..."2017 Apr, 2017 Aug, 2017 Dec....2018 Sep"

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi hackfifi,

     

    For your requirement, you can add the calculate column with specific format, then create hierarchy column with these formatted columns.

     

    Sample:

    Table = ADDCOLUMNS(CALENDAR(DATE(2015,1,1),TODAY()),"Year",FORMAT([Date],"YYYY"),"Month",FORMAT([Date],"MMMM"),"Day",FORMAT([Date],"D"),"Year Month",FORMAT([Date],"YYYY MMM"),"Month Day",FORMAT([Date],"MMM d"))

     

     

    Regards,

    Xiaoxin Sheng

    • hackfifi's avatar
      hackfifi
      Helper V

       

      Thanks Anonymous -

      To implement your solution I followed the below steps:

      1. Create Table "Calendar" as per your formula

      2. Create Relationship: Linked "Date" [Table: Calendar"] & "Period [Table: Summary - Cashflow"

      3. Used fields "Year", "Year Month", "Month Day" in shared axis [replaced "Period"]

      4. Screenshot after implementation as above.

      After implementing your solution, please see above impact while DRILLING DOWN. Also, my Cumulative Calculations are incorrect now.
      I have attached a screen shot in my initial post of what the chart looks like while using "Period" in the Share Axis Field.
      Kindly advise if i have done any steps incorrectly.
      Thanks

       

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi hackfifi,

         

        Can you please share me a sample file to test?

         

        Regards,

        Xiaoxin Sheng