Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
moltra
Helper IV
Helper IV

How to summarize 15 minute readings into Hourly readings.

I have a table the has readings every 15 minutes for each meter.  I want to create a table showing the sum of the four 15 minute readings for each hour.  I also need to have the area and meter name

 

Meter name    Area       Date           Ending Time  Hour  reading
Meter 1area 1 3/1/202109:009123
Meter 2area 1 3/1/202109:009343
Meter 3area 23/1/202109:0092342
Meter 1area 1 3/1/202109:159232
Meter 2area 1 3/1/202109:159456
Meter 3area 23/1/202109:159546
Meter 1area 1 3/1/202109:309143
Meter 2area 1 3/1/202109:309368
Meter 3area 23/1/202109:309554
Meter 1area 1 3/1/202109:459123
Meter 2area 1 3/1/202109:459343
Meter 3area 23/1/202109:459755
Meter 1area 1 3/1/202110:0010545
Meter 2area 1 3/1/202110:0010655
Meter 3area 23/1/202110:0010458
Meter 1area 1 3/1/202110:1510425
Meter 2area 1 3/1/202110:1510457
Meter 3area 23/1/202110:1510325

 

What I am looking to do is create a table with the following.

 

Meter name     Area      Date           Hour  reading
Meter 1Area 13/1/20219621
Meter 2Area 13/1/202191510
Meter 3Area 23/1/202194197
Meter 1Area 13/1/202110Sum hour 10
Meter 2Area 13/1/202110Sum hour 10
Meter 3Area 23/1/202110Sum hour 10

 

If possible I would like to add the ending time period for each 9:15 + 9:30 + 9:45 + 10:00 under the Hour 9 reading.  This way I get all the power usage for the 9 hour period.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @moltra ,

 

In Power query, you can add a new column like this:

pqNewHour =
if Time.Minute([endingTime]) = 0 then [hour] - 1 else [hour]

 

In DAX you can add a new column like this:

daxNewHour = 
SWITCH(
    MINUTE(yourTable[endingTime]),
    0, yourTable[hour] - 1,
    yourTable[hour]
)

 

Then just use your new column as the visual dimension.

 

This gives me the following output:

BA_Pete_0-1617119553212.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

9 REPLIES 9
moltra
Helper IV
Helper IV

I was looking for a table that I could view, but I can do the same thing with a visual.  

BA_Pete
Super User
Super User

Hi @moltra ,

 

In Power query, you can add a new column like this:

pqNewHour =
if Time.Minute([endingTime]) = 0 then [hour] - 1 else [hour]

 

In DAX you can add a new column like this:

daxNewHour = 
SWITCH(
    MINUTE(yourTable[endingTime]),
    0, yourTable[hour] - 1,
    yourTable[hour]
)

 

Then just use your new column as the visual dimension.

 

This gives me the following output:

BA_Pete_0-1617119553212.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




I am looking for the sum of the reading for each hour.  so I need to summarize the 4 readings for each hour and put it in a table.  

Hi @moltra ,

 

I'm not sure I understand. The example I provided IS summing the readings for the four 15-minute segments within the new hour dimension. When the new hour dimensions are added to a visual with the readings, Power BI automatically aggregates the values.

 

From what I can see, my example output is the same as your required output table. The only difference is that the meter totals in mine are for 09:15, 09:30, 09:45, 10:00, as per your requirements here:

"If possible I would like to add the ending time period for each 9:15 + 9:30 + 9:45 + 10:00 under the Hour 9 reading."

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Your Dax does take care of the hourly portion of the problem.  Can you show me the Dax that you used to get the rest of the table, mainly the sum of the readings.

 

I have gotten it to work in DAX Studio, but have not figured out how to do it in Power Bi.

 

 

@moltra ,

 

There's no DAX creating the rest of the table in my example. The [reading] field is in number format so I just drag the field into the table and Power BI automatically aggregates it.

 

If you want to specifically calculate the sum rather than have Power BI auto-aggregate, you can use a measure like this, but it's not entirely necessary:

_sumOfReading = SUM(yourTable[reading])

 

I'm not sure whether you are working on something more complex than you have asked about here, but for just creating the output table as I have, you DO NOT need DAX Studio. You just need to drag the fields from your source table ([meterName], [area], [date], [reading]) into your report in Power BI Desktop, and also drag in your [daxNewHour] OR [pqNewHour] field and PBI will create the output that I provided.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Yes, I am working on something more complex.  I am trying to figure out why there is a slight difference between two reports pulling data from the same data source.  The difference is around 0.05%.

@moltra ,

 

Fair enough.

 

Was there anything else you needed to help with your original question or does what I said make sense?

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




yes it makes since.  Thanks for your help

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors