Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello! I am working on a project, and I need my time to be in standard time (not military time). I think I got this coded, but when I go to sort my graph, it doesn't sort by 1am - 11pm.... Attached is my code and screenshots of my data.
Thanks in advance!
Solved! Go to Solution.
@Anonymous Instead of making it text, you can make it a time format pushed to the hour, then format it how you please, and it will then sort appropriately.
TIME function (DAX) - DAX | Microsoft Docs
Time_Hour = TIME(hour([Time]),0,0)
Then in the ribbon or in the modeling tab (in modelling you can do custom formats!) you can pick the format you want it to display as.
You can get the X-Axis to show each by changing it to "Categorical" too:
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
Hi @Anonymous
Try this
Hour_Real =
VAR aux_ = 1/24
RETURN
aux_*HOUR(Table1[Time])
converting the calculated column to type Time
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
@Anonymous Instead of making it text, you can make it a time format pushed to the hour, then format it how you please, and it will then sort appropriately.
TIME function (DAX) - DAX | Microsoft Docs
Time_Hour = TIME(hour([Time]),0,0)
Then in the ribbon or in the modeling tab (in modelling you can do custom formats!) you can pick the format you want it to display as.
You can get the X-Axis to show each by changing it to "Categorical" too:
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 158 | |
| 132 | |
| 116 | |
| 79 | |
| 54 |