Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate average, count same group as 1

Hello everyone,   In Power BI I need to make the calculations which you can see below.   - I want to know the average from column A, B and C seperate. - Each company counts as one. Company x has...
  • VahidDM's avatar
    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/