The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I'm working with time duration that comes in seconds. I've already converted the metric to hh:nn:ss, but that won't work for our purposes as we need a sum or average to show for whatever time frame the end user selects. Two alternatives were suggested, but I'm unable to get the DAX formula to work.
I'd like to convert seconds to hours so 30 min shows as .5 and so on. I've been unable to find a formaula for this, however.
Solved! Go to Solution.
Hi @SChariton ,
As @lbendlin said, you can divide the seconds value by 3600 to get the hour value. Detailed steps are shown below.
1. Based on your description, I created this data.
2. Create a calculated column or measure and write an expression. In this example I created a calculated column. For more information about the divide function, please refer to the documentation: DIVIDE function (DAX) - DAX | Microsoft Learn.
hour = DIVIDE('Table'[sec],3600)
3. The results can be formatted in the table tool, in this example I kept the results to 3 decimal places.
4. The final result is shown in the figure below.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SChariton ,
As @lbendlin said, you can divide the seconds value by 3600 to get the hour value. Detailed steps are shown below.
1. Based on your description, I created this data.
2. Create a calculated column or measure and write an expression. In this example I created a calculated column. For more information about the divide function, please refer to the documentation: DIVIDE function (DAX) - DAX | Microsoft Learn.
hour = DIVIDE('Table'[sec],3600)
3. The results can be formatted in the table tool, in this example I kept the results to 3 decimal places.
4. The final result is shown in the figure below.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Have you considered dividing the seconds by 3600 ?