Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Format Function isn't accepting DAX custom date/time characters

I have a Date/Time field in this format: "6/13/2017 1:47:00 PM"   I want to create a new column that displays in this format: "1pm"   The DAX function reference for Format suggests that the way t...
  • v-yulgu-msft's avatar
    9 years ago

    Hi Anonymous,

     

    To get hour in format "1PM", please try below formula:

    Hour Created = FORMAT('DataTable'[Created DateTime], "h AM/PM")

    Also, using AM/PM, am/pm, A/P, a/p can return expected result.

     

    Best regards,
    Yuliana Gu