Forum Discussion

SachinC's avatar
SachinC
Helper V
6 years ago
Solved

Sort by Date X - Axis

Hi, I am connecting to a SQL server instance. I have a date/time field called DateInspected. I want to use this field but want to convert this date field to mm-yyyy and use this in a bar chart and ...
  • MFelix's avatar
    MFelix
    6 years ago

    Hi SachinC ,

     

    Syntax I gave you is for a DAX column you should replace the dot comma by comma (it's regional setting thing).

    FORMAT([DateInspected],"mm-yyyy")

     

     

    On the query editor the formula should be:

    Text.Combine({Date.ToText([DateInspected], "MM"), "-", Date.ToText([DateInspected], "yyyy")})