Forum Discussion
Anonymous
9 years agoNot applicable
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...
- 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
v-yulgu-msft
Microsoft Employee
9 years agoHi 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
- Anonymous9 years agoNot applicable
That did that trick. Where did you find it? Is there a better reference for the Power BI Format function? What would you use for minutes, since both lower and upper-case m and mm refer to month?