Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear Users,
The measure I have is the total time spent by a person doing a task. and this works fine in a table however, it does not work in any graphs. I understand that this is because the measure is calculated and then recognised as a text. however, I am unable to find a solution to this problem.
The DAX code I have used to calculate the measure is as follows:
Total Time Spent =
VAR Total_Hours = SUMX(Table1,HOUR(Table1[Time Spent (hh:mm:ss)]) + DIVIDE(MINUTE(Table1[Time Spent (hh:mm:ss)]),60) + DIVIDE(SECOND(Table1[Time Spent (hh:mm:ss)]),3600))
VAR DaysTotal = DIVIDE(Total_Hours,24)
VAR HoursTotal = (DaysTotal)*24
VAR HoursInt = TRUNC(Total_Hours)
VAR MinutesTotal = (HoursTotal - HoursInt) * 60
VAR MinutesInt = TRUNC(MinutesTotal)
VAR SecondsTotal = ROUND((MinutesTotal - MinutesInt)*60,0)
RETURN
FORMAT(HoursInt,"00")&":"&FORMAT(MinutesInt, "00")&":"&FORMAT(SecondsTotal, "00")&" "
Please advise how to solve this issue?
Hi @UmairKamal ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
Using the format function does force a conversion to text formatting.However only digital format displays are accepted on most visual objects. With this in mind, we can use the dynamic format of measure.
First, ensure that the options in the preview feature are turned on
Create a measure
Measure = HOUR(SELECTEDVALUE('Table'[Time]))*10000+MINUTE(SELECTEDVALUE('Table'[Time]))*100+SECOND(SELECTEDVALUE('Table'[Time]))
Ensure that the y-axis diapaly units option is none
Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@Anonymous thanks for your reply. I have followed the steps as you mention but I am not getting the results. In fact, this measure is not even visible in the Matrix Visual.
It may return Blank values.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 71 | |
| 50 | |
| 46 | |
| 44 |