Forum Discussion
dvhez
Helper II
7 years agoAverage by category AND date
I'd like to calculate the average of CMg for every Bloque Horario category (A, B and C). I tried with the following measure which works only if select one month. However, my data has 10 years with 12...
- 7 years ago
Hi dvhez ,
From your comment: calculate only the block (A, B or C) corresponding to each month and year?
It now sounds like you do not need the Year|Month|Hour to average by but Year|Month ?
Is this the result you are after?
Jan 2019[ A] = 44.03 , Jan 2019 [B] = 43.0
Feb 2019 [A] = 45.62 , Feb 2019 [B] = 44.59If so here is the code for this one. Note, filter context is crucial when using these calculations
_Measure5 = CALCULATE ( AVERAGE(Data[CMg] ), FILTER ( ALL( Data ), Data[Bloque Horario] <= MAX ( Data[Bloque Horario] ) && Data[Date] <= MAX(Data[Date]) ))
Deepraj
2 years agoNew Member
how can we calculate Month Average for each month for combined year. For eg how can we create Month Average for Jan as a single value where it adds all Jan values and calculate average (eg from 2017,2018,2019ā¦..2023)
and similarly for Feb, Mar... Dec
- Ashish_Mathur2 years ago
Super User
Hi,
Share some data, explain the question and show the expected result.
- Deepraj2 years agoNew Member
ā