cancel
Showing results for
Did you mean:
Helper III

## Earliest Time of each hour

Hi Team,

Need help in achieving the below results.

The source data has value based on timestamp and need to find the min value of hour of time from the dataset.

Source:

``````Source:
TIME	VALUE
11/19/2020 15:31	167.79
11/19/2020 15:31	168.01
11/19/2020 15:21	167.7
11/19/2020 15:11	167.7
11/19/2020 15:11	167.7
11/19/2020 15:01	167.92
11/19/2020 15:01	167.7
11/19/2020 14:51	167.92
11/19/2020 14:51	167.7
11/19/2020 14:41	167.92
11/19/2020 14:41	167.7
11/19/2020 14:31	167.91
11/19/2020 14:31	167.7
11/19/2020 14:21	167.91
11/19/2020 14:20	167.7
11/19/2020 14:10	167.7
11/19/2020 14:01	167.79
11/19/2020 14:00	168.01
11/19/2020 13:50	168.01
11/19/2020 13:40	167.91
11/19/2020 13:40	167.7
11/19/2020 13:30	167.7
11/19/2020 13:30	167.7
11/19/2020 13:20	168.01
11/19/2020 13:20	168.01
11/19/2020 13:10	168.01
11/19/2020 13:00	168.01

Output:
11/19/2020 15:00	167.7
11/19/2020 14:00	168.01
11/19/2020 13:00	168.01``````

Thanks ,

Raj

1 ACCEPTED SOLUTION
Community Support

Hi @rajveer1117 ，

Based on your description, you can do some steps as follows.

1. Create a column to group by hour.

_hour = HOUR([TIME])

2. Create a measure.

calculated_value =

var x1=CALCULATE(MIN('Case2_2'[TIME]),ALLEXCEPT(Case2_2,Case2_2[_hour]))

return

CALCULATE(MIN('Case2_2'[VALUE]),FILTER(ALL('Case2_2'),'Case2_2'[TIME]=x1))

3. Create a table visual.

Result:

Hope that's what you were looking for.

Best Regards,

Yuna

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

4 REPLIES 4
Community Support

Hi @rajveer1117 ，

Based on your description, you can do some steps as follows.

1. Create a column to group by hour.

_hour = HOUR([TIME])

2. Create a measure.

calculated_value =

var x1=CALCULATE(MIN('Case2_2'[TIME]),ALLEXCEPT(Case2_2,Case2_2[_hour]))

return

CALCULATE(MIN('Case2_2'[VALUE]),FILTER(ALL('Case2_2'),'Case2_2'[TIME]=x1))

3. Create a table visual.

Result:

Hope that's what you were looking for.

Best Regards,

Yuna

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

Super User IV

@rajveer1117 , Create a column like this as suggested in last update

TIME new = [TIME].date + time(hour([TIME],0,0)

And then use this in visual with measure given below

firstnonblankvalue(Table[TIME], max(Table[Value]))

Proud to be a Super User!

Helper III

As i am using the direct query , the solution above is showing error.

Super User IV

You should be able to get your result as follows

- in the query editor, split your datetime column at the space and convert to date and time

- add a column by selecting your time column and in the Time pull down choose Hour

- make a table visual with the Date column and the new hour column

- also add the Value column and choose min as the aggregation (or write a measure with MIN() )

Note: if you table is already loaded, you could also do the same with DAX columns, but I would do it in query.

Regards,

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

Announcements

#### Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks