'How to get hourly visualisation by adding Outputs from half-hourly data in Power BI?

I have some data coming in Power BI from SQL Server. The data gives half-hourly output of the plant. I want to convert it to hourly format by adding the output at two 30 mins interval and having it into a new column. Sample Data:

Time Output
2022-01-02 01:30:00.000 -3
2022-01-02 02:00:00.000 6
2022-01-02 02:30:00.000 -20
2022-01-02 03:00:00.000 40

The resultant column will have Output for 01:30:00 and 02:00:00 added as 3 (-3+6); similarly for 02:30:00 and 03:00:00 as 20 (-20+40).

Time Output Result
2022-01-02 01:30:00.000 -3
2022-01-02 02:00:00.000 6 3
2022-01-02 02:30:00.000 -20
2022-01-02 03:00:00.000 40 20

Please can someone help by letting me know what expression I need to use to create such a column (or measure). Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source