Hello @Tonny,
What does the line protocol look like? Is your data in different measurements? or are c1 and c2 tags? If you’re looking to perform math across measurements I recommend looking at this blog and this blog.

I want to know the amount used by every unit (per hour, per day, per week, per month).
The formula to calculate the used energy for Unit1 = C1 + C2
The formula to calculate the used energy for Unit2 = C3

Eventually I want to have a table that looks something like this.

Another option is that everything is stored in the measurement like this
Time1 C1=123 C2=456 C3=789 … C50 = 321
This is easier for calculation, but less flexible