Forum Discussion
Average by category AND date
- 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]) ))
Hi,
Share the link from where i can download your PBI file. Also, it will be nice to also see your calculation in an Excel workbook so that i can compare my DAX formula's result with your Excel formula's result.
Hi Ashish_Mathur , you can download the pbix from here:
The output logic and result would be the same as the picture I posted minutes ago.