cancel
Showing results for
Did you mean:
Helper III

## Daily average in calculated column

Hi Community,

I'm trying to find a way to calculate a daily average of a hourly prices of a certain market on historic series of 5 years. I need it in a column once I need to take that figures for a further join table.

The data is in this "Sample Table":

 Date Price 2021-05-06 5 2021-05-06 3 2021-05-06 1 2021-05-06 1 2021-05-06 2 2021-05-05 2 2021-05-05 3 2021-05-05 1 2021-05-05 4 2021-05-05 5

And the desired output is this format:

 Date Price Daily avg 2021-05-06 5 2.4 2021-05-06 3 2.4 2021-05-06 1 2.4 2021-05-06 1 2.4 2021-05-06 2 2.4 2021-05-05 2 3 2021-05-05 3 3 2021-05-05 1 3 2021-05-05 4 3 2021-05-05 5 3

I'm trying to use:

Daily Avg =

calculate(AVERAGE("Sample Table"[Price]),"Sample Table"[Date]), but output is the hourly price for each row, instead of the average.

Any clue on this, please?

Best regards
1 ACCEPTED SOLUTION
Super User II

Hi @DXF_83

take a look at the following solution:

``````Average by Day =
CALCULATE ( AVERAGE ( 'Table'[Price] ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
``````

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

3 REPLIES 3
Helper III

Thanks @FrankAT and @amitchandak for your tips and help!

Cheers

Super User II

Hi @DXF_83

take a look at the following solution:

``````Average by Day =
CALCULATE ( AVERAGE ( 'Table'[Price] ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
``````

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Super User IV

@DXF_83 , Try a new column like

averageX(filter(Table, [Date] =earlier([Date])),[Price])

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Announcements

#### Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

#### 2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.