Forum Discussion
Calculate average, count same group as 1
- 4 years ago
Hi Anonymous
Try this code for each column, for instance for column A:
Avr. A = VAR _A = SUMMARIZE( 'Table', 'Table'[Company Name], "Avr.", AVERAGE( 'Table'[A] ) ) RETURN AVERAGEX( _A, [Avr.] )Output:
Avr. B = VAR _A = SUMMARIZE( 'Table', 'Table'[Company Name], "Avr.", AVERAGE( 'Table'[B] ) ) RETURN AVERAGEX( _A, [Avr.] )Avr. C = VAR _A = SUMMARIZE( 'Table', 'Table'[Company Name], "Avr.", AVERAGE( 'Table'[C] ) ) RETURN AVERAGEX( _A, [Avr.] )If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi Anonymous
Try this code for each column, for instance for column A:
Avr. A =
VAR _A =
SUMMARIZE( 'Table', 'Table'[Company Name], "Avr.", AVERAGE( 'Table'[A] ) )
RETURN
AVERAGEX( _A, [Avr.] )
Output:
Avr. B =
VAR _A =
SUMMARIZE( 'Table', 'Table'[Company Name], "Avr.", AVERAGE( 'Table'[B] ) )
RETURN
AVERAGEX( _A, [Avr.] )Avr. C =
VAR _A =
SUMMARIZE( 'Table', 'Table'[Company Name], "Avr.", AVERAGE( 'Table'[C] ) )
RETURN
AVERAGEX( _A, [Avr.] )
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi VahidDM ,
I used your calculations in Power BI and I think it works. The outcome of A is correct now. Tomorrow night I will try it on more columns to check it. I will let you know if it works. Already, thank you very much for your input! I appreciate it.