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
Waaaaaa
Frequent Visitor

How to calculate average time?

Hi,

 

How to do "total time" / "total users" = average time? My goal here is to get an average time per user. 

 

The Time I have is in decimal form. I created a measure and turn them into "hour" : "min".

 

Measure I have: Time = FORMAT(AVERAGE('xxx'[Time on page]),"nn:ss")

 

Then, I tried to use the measure to divide users. It won't allow me to do that.

 

Then I tried to use the decimal numbers to divide users, it returned 0.

Avg time = DIVIDE (SUM('xxx'[Time on Page]), SUM('xxx'[Users]),0)

 

Capture.JPG

 

Please help!

 

6 REPLIES 6
v-eqin-msft
Community Support
Community Support

Hi @Waaaaaa ,

 

Could you tell me if my post helps you a little? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.Hope to hear from you‌‌😀

 

Best Regards,
Eyelyn Qin

 

v-eqin-msft
Community Support
Community Support

Hi @Waaaaaa ,

 

Not very clear about your expected output... But if you want to display the same average value on each row,please try:

Measure = CALCULATE( AVERAGE('Table'[Time on Page]),ALLSELECTED('Table'))

Eyelyn9_0-1630293070056.png

 

Or please provide more details to help us clarify your scenario.

 

Best Regards,
Eyelyn Qin
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

@Waaaaaa Chelsie Eiden's Duration - Microsoft Power BI Community


@ 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...

@Greg_Deckler  I am not sure how the article going to solve my issue here. Can you please tell me how can I get the average "mm:ss" instead of 0? Thanks!

@Waaaaaa You can't divide using the measure because it is text. So, if you use Chelsie Eiden's Duration and keep the number as a number (don't use FORMAT) then you could use the measure.


@ 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...

@Greg_Deckler  The column "time on page" is in decimal. How can I change these decimal numbers to seconds? Thanks a lot!

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.