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! It's time to submit your entry. Live now!
Hello,
I am trying to convert an integer, for example 63148, which is the amount of seconds from midnight, into a time format such as '5:36PM'.
I've tried using combinations of changing the box properties to Time, using a mix of conversion functions, but I still end up with an #Err in my field. I tried looking this up and couldn't find a specific use case solution for what I'm trying to do.
Any help would be appreciated.
Solved! Go to Solution.
Hi @mcquerry-dillon ,
In the case of CDate expression, she can only convert a string of date type to a date, so if she converts the integer directly, an error will be reported.
Below is my table:
I create Hrs , Mins , Time column
The following expression might work for you:
Time =Fields!Hrs.Value & Format(Fields!Hrs.Value ,":") & Format(Fields!Mins.Value)
Mins = Fields!NewColumn0.Value\60 - Fields!Hrs.Value*60
Hrs = Fields!NewColumn0.Value\3600
Time1 = CDate(Fields!Time.Value)
The final output is shown in the following figure:
Expression examples in Power BI Report Builder - Power BI | Microsoft Learn
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mcquerry-dillon ,
In the case of CDate expression, she can only convert a string of date type to a date, so if she converts the integer directly, an error will be reported.
Below is my table:
I create Hrs , Mins , Time column
The following expression might work for you:
Time =Fields!Hrs.Value & Format(Fields!Hrs.Value ,":") & Format(Fields!Mins.Value)
Mins = Fields!NewColumn0.Value\60 - Fields!Hrs.Value*60
Hrs = Fields!NewColumn0.Value\3600
Time1 = CDate(Fields!Time.Value)
The final output is shown in the following figure:
Expression examples in Power BI Report Builder - Power BI | Microsoft Learn
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
I would recommend the following DAX:
If this works please mark this message as solution.
hello,
I should clarify that I'm using the PowerBI Report Builder so this is what I'm trying to work with
The op_time field value is an integer as mentioned earlier in seconds
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 60 | |
| 49 | |
| 30 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 131 | |
| 103 | |
| 58 | |
| 39 | |
| 31 |