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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jjr333
Advocate I
Advocate I

Aggregate hourly readings by Date

I have a date table, 1 row per day.
And a data table with sensor readings per hour per day. The date column has values like 1-1-2013 23:00:00

The tables are joined, 1 to many.

Somehow I can't create a measure that calcualtes the SUM or AVERAGE per day.

O3 Sum = SUMX(LGResEscolar;'LGResEscolar'[O3])

It returns only 1 value for each date, i.s.o. a sum or average.

Any sugestions?

Cheers,

Julian

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@jjr333 Please try to add an another column in your data table to derive the date from datetime value. Then join the date value field with Date Dimension, your measure will work fine !!

image.png

Measure is 

Test300 = SUMX(Test300GroupDateTime,Test300GroupDateTime[Value])

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@jjr333 Please try to add an another column in your data table to derive the date from datetime value. Then join the date value field with Date Dimension, your measure will work fine !!

image.png

Measure is 

Test300 = SUMX(Test300GroupDateTime,Test300GroupDateTime[Value])

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@PattemManohar  Thank you!

Hello Pattem,
What would be the DAX code using BETWEEN, or something similar (Date >= dimDate <= Date)?

Below an SQL example comparing week numbers after joining two table.

WHERE     
	AND HRS.IDHuis = @Huis 
	AND HRS.Jaar = @Jaar 
	AND HRS.WEEK BETWEEN @WeekBegin AND @WeekEind

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors