Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to get Average if Data Type is is "Text"

Hello Everyone!

I'm having a hard time to get the average of Turn Around Time (TAT) that is in the "Text Format"

my TAT format is like this "hh:mm:ss" and once i visualize this using CARD, there's no option to make it as "Average"

 

Note: there is no "Average" option in "Fields" that's

Nelzkie09_0-1675695937979.png

 

TYIA!

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @Anonymous 

You can creata a measure

Average_seconds = AVERAGEX('Table (2)',LEFT([Column1],2)*3600+MID([Column1],4,2)*60+RIGHT([Column1],2))

Then put the measure to the card visual

vxinruzhumsft_0-1675737348821.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @Anonymous 

You can creata a measure

Average_seconds = AVERAGEX('Table (2)',LEFT([Column1],2)*3600+MID([Column1],4,2)*60+RIGHT([Column1],2))

Then put the measure to the card visual

vxinruzhumsft_0-1675737348821.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , You have first create a number out it take avg and then again convert to text

 

Value = averagex( Table, (left([Col],2) *3600) + (mid([Col],4,2) *60) + (right([Col],2) *3600)  )

 

then you can convert to text again 

 

quotient([Value],3600) & ":" & quotient(mod([Value],3600),60) & ":" mod(mod([Value],3600),60)

 

Duration
https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-using-dax
https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-in-dax.aspx
https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?GroupId=547&MessageKey=814a2cb4-3cca-4cd1-a620-c467adeaaaf6&CommunityKey=b35c8468-2fd8-4e1a-8429-322c39fe7110&tab=digestviewer

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.