Forum Discussion
averageif
- 7 years ago
Can you show with an example what you need? A small table with sample data and the required result.
I don't understand what you mean by
... i don't want to precise a specific value like ( "X"), but compare the value of each row.
Maybe this:
NewColumn = CALCULATE ( AVERAGE ( 'table'[column2] ), FILTER ( 'table', 'table'[column1] = EARLIER ( 'table'[column1] ) ) )
Thank you for your message,
For each row, i want to compare the value in [column1] and calculate an average of the [Column2] of all the rows having the same value in [column1]
In excel :
Column 1 Column 2 Average
c 6 6 Average = AVERAGEIF([Column 1],"="&[@[column 1]),[column 2])
a 1 1
c 2 6
b 2 3
b 4 3
c 10 6
Thank you for your help !
Clement
Ok, so both answers above should work. Mine if you want it in a calculated column and Ashish_Mathur's if you want it with a measure.
- ClementSendra7 years agoNew Member
Thank you very much it is exactly what i was looking for !
Clement