Forum Discussion
Average over certain period
- 6 years ago
Hi CalvinL ,
We can use the Power Query and create a calculate column to meet your requirement.
1. In Power Query Editor, we can use Date only and Time only functions to create two columns.
2. Then we can create a calculate columns in data view,
Column = var time1 = TIME(0,0,0) var time2 = TIME(12,0,0) return CALCULATE(AVERAGE('Table'[Value]),FILTER('Table',EARLIER('Table'[Date.1])='Table'[Date.1] && 'Table'[Time]>=time1&&'Table'[Time]<=time2))If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply. For the result, I want it to be displayed in a separate column, lets call it "Peak Values". The reason I want it in a separate column is so that I can then see in a line chart that on this day, this was the peak value.
Is that possible? I've given it a try in DAX but no joy. I know in excel it's quite easy with a BETWEEN statement, but unsure about DAX.
HI CalvinL ,
You can try this measure.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)