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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Ibrahim_shaik
Helper V
Helper V

How to Aggregate Temperature Column Per Hour Per Day

Hi Power BI Community,

 

I have a date, time column in the time column i have 5 minute interval timestamp and a temp column which has temp value for every 5 minute timestamp.

 

I want to create a column in which i get the average temp value of the hour of the 5 minute intervals in an hour per day that is 24 values for a day.

 

Please give a solution.

Temp per hour.png

 

I have used this DAX it gives me a blank column.

 

AverageTemperaturePerHour =
VAR CurrentDate = MAX('AmbTemp'[date])
VAR CurrentHour = HOUR(MAX('AmbTemp'[time]))
RETURN
    CALCULATE(
        AVERAGE('AmbTemp'[t_out]),
        FILTER(
            'AmbTemp',
            'AmbTemp'[date] = CurrentDate &&
            HOUR('AmbTemp'[time]) = CurrentHour
        )
    )
 
Please give a solution.

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Ibrahim_shaik 

May I ask if you have already solved this problem? On top of the DAX you wrote, just add an ALL.

vyaningymsft_0-1710827497791.png

Measure:

 

Expected = 

VAR CurrentDate = MAX('AmbTemp'[date])
VAR CurrentHour = HOUR(MAX('AmbTemp'[time]))
RETURN
    CALCULATE(
        AVERAGE('AmbTemp'[t_out]),
        FILTER(
            ALL('AmbTemp'),
            SELECTEDVALUE('AmbTemp'[date]) = CurrentDate &&
            HOUR('AmbTemp'[time]) = CurrentHour
        )
    )

 

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @Ibrahim_shaik 

May I ask if you have already solved this problem? On top of the DAX you wrote, just add an ALL.

vyaningymsft_0-1710827497791.png

Measure:

 

Expected = 

VAR CurrentDate = MAX('AmbTemp'[date])
VAR CurrentHour = HOUR(MAX('AmbTemp'[time]))
RETURN
    CALCULATE(
        AVERAGE('AmbTemp'[t_out]),
        FILTER(
            ALL('AmbTemp'),
            SELECTEDVALUE('AmbTemp'[date]) = CurrentDate &&
            HOUR('AmbTemp'[time]) = CurrentHour
        )
    )

 

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.