Forum Discussion
Anonymous
7 years agoNot applicable
subtractung average column value from another column values
I have 2 columns
col1 col2
| 22 | 27 |
| 42 | 48 |
| 20 | 19 |
| 28 | 36 |
| 25 | 35 |
I need added col3. the values of col3 is col2-avg(col1)
i.e avg of col1 is 27.4
col3 values are
27-27.4= -0.4
48-27.4=20.6
19-27.4= -8.4
36-27.4 = 8.6
35-27.4= 7.6
How to calculate this operation in power bi ??
Hi,
Drag Col1 and Col2 fields to the row labels section of your Table/Matrix visual and write this measure
=MIN(Table1[Col2])-CALCULATE(AVERAGE(Table1[Col1]),ALL(Table1))
Hope this helps.
2 Replies
- Ashish_MathurSuper User
Hi,
Drag Col1 and Col2 fields to the row labels section of your Table/Matrix visual and write this measure
=MIN(Table1[Col2])-CALCULATE(AVERAGE(Table1[Col1]),ALL(Table1))
Hope this helps.
- AnonymousNot applicable
HI Anonymous
Try this approach:
Measure = VAR vCol1_Avg =CALCULATE(AVERAGE(Table1[Col1]),ALLSELECTED(Table1)) VAR vCol2_val = MAX(Table1[Col2]) RETURN vCol2_val - vCol_Avg
Thanks
Raj