Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 to do it would be with the format string "htt", so my function looks like this:
Hour Created = FORMAT('DataTable'[Created DateTime], "htt")
But it doesn't recognize "tt" and instead of "1PM", it returns "13tt". Won't take "t" either. Also, in testing, it doesn't respect "gg", "z", "zz", or "zzz". It also treats minute characters "m" and "mm" the same as month characters "M" and "MM" (so not sure how you would isolate minutes), "y" displays the numeric day of the year, and "yyy" seems to display number of days since June 1970.
Is there a different reference sheet for the Format function as it is used in Power BI?
Solved! Go to Solution.
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
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
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?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
50 | |
45 | |
38 | |
38 |