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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to calculate the mean of specific values of time

Hi all,

I explain my situation:

I have this matrix:

dbb95_0-1605252294953.png

Where I minimize selecting the greatest values in black in the next table.

 

dbb95_1-1605251358493.png

From the matrix where I have selected the maximum values for T max, TG max and times (not maximum, the most recent), I would like to show in the table on the right the mean  of the REACH Y value (time) between the component 32 and 64 (shown in green colour).

For Tmax mean between 83,66 and 107.33 -> 95.5

For Tgmax mean between 78.45 and 81.61 -> 81.61

 

For Tmax and Tgmax we have followed these steps:

-Select the calculation -> Promedio por categoría (Mean by category)

-Select the values for the calculations -> Tmax and TGmax -> The maximum (max.)

-Select the category -> Recipe (R1)

 

dbb95_2-1605251618805.png

 

 

If I try to do the same with values for time, the system only allows me to select the values as COUNT of time... but I would like to choose the values that are the green values in the first screenshot.

 

dbb95_3-1605251862344.png

 

So the result that I want should be the mean of 6:33:59 and 4:41:56. ( that are the greates values of its group)

Thanks to all

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

According to my understand, you want to calculate the average of time ,right?

You could use the following formula:

average time =
VAR _ave =
    CALCULATE (
        AVERAGEX (
            'Table',
            HOUR ( [Reach.x] ) * 60 * 60
                + MINUTE ( [Reach.x] ) * 60
                + SECOND ( [Reach.x] )
        )
    )
VAR _h =
    TRUNC ( ( _ave ) / 3600 )
VAR _m =
    TRUNC ( MOD ( _ave, 3600 ) / 60 )
VAR _s =
    TRUNC ( MOD ( _ave, 60 ) )
RETURN
    TIMEVALUE ( _h & ":" & _m & ":" & _s )

 My visualization looks like this:

11.17.2.1.PNG

 

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

According to my understand, you want to calculate the average of time ,right?

You could use the following formula:

average time =
VAR _ave =
    CALCULATE (
        AVERAGEX (
            'Table',
            HOUR ( [Reach.x] ) * 60 * 60
                + MINUTE ( [Reach.x] ) * 60
                + SECOND ( [Reach.x] )
        )
    )
VAR _h =
    TRUNC ( ( _ave ) / 3600 )
VAR _m =
    TRUNC ( MOD ( _ave, 3600 ) / 60 )
VAR _s =
    TRUNC ( MOD ( _ave, 60 ) )
RETURN
    TIMEVALUE ( _h & ":" & _m & ":" & _s )

 My visualization looks like this:

11.17.2.1.PNG

 

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.