Forum Discussion
Average basis hour duration from timestamp
- 6 years ago
Took me longer than I would like to admit π Anyway, I solved it, by creating a calculated column with the following formula:
Last48Hours = AVERAGEX(FILTER(Table1, Table1[Timestamp] <= EARLIER(Table1[Timestamp]) && Table1[Timestamp] > EARLIER(Table1[Timestamp])-40/24), Table1[Value])The reason it took me longer than I expected was both 'how to add hours to a datetime' and also the double filter. Anyway, this will result in the following table:
This was fun, hope it helped π
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Kudo's are welcome π
Took me longer than I would like to admit π Anyway, I solved it, by creating a calculated column with the following formula:
Last48Hours = AVERAGEX(FILTER(Table1, Table1[Timestamp] <= EARLIER(Table1[Timestamp]) && Table1[Timestamp] > EARLIER(Table1[Timestamp])-40/24), Table1[Value])The reason it took me longer than I expected was both 'how to add hours to a datetime' and also the double filter. Anyway, this will result in the following table:
This was fun, hope it helped π
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Kudo's are welcome π
- Anonymous6 years agoNot applicable
Both the answers work as absolute solution to my problem however accepting the first answer as solution for below 2 reasons -
1. ofcourse the first solution.
2. It works on existing timestamp column instead of additional helper column.
Tons of thanks to both! π