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
Anonymous
Not applicable

Calculate daily average with several records per day

Hi There!

I have a table  with several temperature records per location per day at different times. I'm trying to calculate the daily average, so I can run other calculations i.e. difference from annual average, cumulative difference, etc, but I can't get this daily average right.

I have a calendar table with both date_time and date_only, and tried several methods posted in the forum, but I can't get a static average per day.

Please see some sample data below. Thanks in advance for your help!  🙂

1. AVERAGEX ( VALUES (Table[Date_only]), [D])

2. CALCULATE (

AVERAGE(Table[D] ),

FILTER ( ALLSELECTED ( Table ), Table[Date_only ]=EARLIER(Table[Date_only ]

)))

3. Avg_D = CALCULATE(AverageX(Values('Table'[Date_only]), CALCULATE(SUM('Table)'[Values]))) ,filter(all('Table'[Date_only]),'Table)'[Date_only] <=max'Table'[Date_only])))

 

LauraGR_2-1678948297735.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , if you plan to overall number

 

then you need a measure like, assuming D is a measure

 

calculate(AVERAGEX ( VALUES (Table[Date_only]), [D]), allselected())

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Anonymous
Not applicable

Thanks for your response @amitchandak! My data was in a column format so I created a measure (D_Measure) so I could apply your suggested measure: calculate(AVERAGEX ( VALUES (Table[Date_only]), [D]), allselected())

It looks like it's calculating an average over the whole dataset, not by day. 

Thanks in advance for your suggestions!

LauraGR_0-1679268212608.png

 

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.