Forum Discussion

badger123's avatar
badger123
Icon for Resolver I rankResolver I
7 years ago
Solved

Format date axis

Please can someone help me with formatting date axis... I've had so much trouble with this.    Basically I have this chart, which is currently using date hierarchy, month:    What I am tryi...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Create two columns in the same table as your date like this:

     

    date_display = FORMAT(dimCal[calDate],"mmm YYYY")
    date_BOM = EOMONTH(dimCal[calDate],-1) + 1
     
    Set date_display to sort by date_BOM, and use date_display on the x axis of your chart.
     
    The FORMAT statement returns text, and PowerBI has no idea it represents a date, so it will just be sorted alphanumerically. You cannot sort that by the calDate column because there are multiple date values per date_display values. date_BOM ensures you have one date per date_display value which PowerBI will sort according to the calendar.