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
RGI
Helper III
Helper III

Average of Time column

I have a few Time columns in MSSQL.

I'm hoping to display these with their AVERAGE in a table.

Screen Shot 2018-07-23 at 11.47.11.png

The actual times on the rows are correctly displayed, but no option to display a final total (AVERAGE).

Is this possible?

Currently I'm using Direct Query, but could easily switch to Import.

I can, if it makes it easier, store the times as seconds (Integer) in MSSQL instead of Time.

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

See if this article helps:

 

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @RGI,

 

It seems that you want to calculate the average of your time, you could have a good reference of this similar thread.

 

If you still need help, please share your data sample and your expected output, so that we can help further investigate on it?

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
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

3 REPLIES 3
RGI
Helper III
Helper III

My solution so far:

 

1) I changed the [Time] column in the database to [Int] (seconds).

2) I implemented a new measure as

 

Average Time to Empty Bin = TIME(INT(AVERAGE(Wave[Average Seconds to Empty Bin])/3600),INT(MOD(AVERAGE(Wave[Average Seconds to Empty Bin]),3600)/60),0)

 

This now shows the correct data in the column and a nice average in the total row.

 

However, as I've posted in this thread my slicers have stopped working.

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @RGI,

 

It seems that you want to calculate the average of your time, you could have a good reference of this similar thread.

 

If you still need help, please share your data sample and your expected output, so that we can help further investigate on it?

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

See if this article helps:

 

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.