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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Issue calculate the mean of a defined time.

Hi all,

 

I need your help.

I am trying to calculate the mean of the most recent value for a specific time.

 

This is my situation:

I have reached the values for  Tmax and TGmax according to the serial number (32, 65)

What I would like to have now is the same but with the times shown in red colour.

 

dbb95_0-1605169982467.png

 

When I try to do that, the system takes the value as "count", so the final result that PBI shows is 3,00. It should be 5:00:00 aprox.

 

How can I do this?

 

Thank for your help!!!

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can try to use Convert() function to convert the data type to datetime and adjust the date format.

I have create a sample like this:

A_reach.y =
CONVERT (
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Reach. y]
                = CALCULATE ( MAX ( 'Table'[Reach. y] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) )
        ),
        [Reach. y]
    )
        / DISTINCTCOUNT ( 'Table'[ID] ),
    DATETIME
)

re.png

Attached the sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
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-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can try to use Convert() function to convert the data type to datetime and adjust the date format.

I have create a sample like this:

A_reach.y =
CONVERT (
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Reach. y]
                = CALCULATE ( MAX ( 'Table'[Reach. y] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) )
        ),
        [Reach. y]
    )
        / DISTINCTCOUNT ( 'Table'[ID] ),
    DATETIME
)

re.png

Attached the sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
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 , refer if this can help

https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-in-dax.aspx

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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