1
votes

I have a table in powerbi that has columns:

process | row_count |  
    P1          1           
    P1          2      
    P1          3       
    P2          4        
    P2          5       
    P3          2      
    P3          1   

and I want to add a column that will have the average row_count of each process.

For example,

process | row_count |  avg_row_count  |
P1          1              2
P1          2              2
P1          3              2
P2          4              3
P2          5              3
P3          2              1
P3          1              1

Does anyone know how to do this using Dax /powerbi?

1
It's not clear to me how you're getting those number in the 3rd column. - Alexis Olson
avg_row_count = CALCULATE( AVERAGE('Table1'[row_count]), ALLEXCEPT('Table1','Table1'[process]) ) - חִידָה
how P2 average is 3? - mkRabbani

1 Answers

0
votes

DAX measure for New calculated Column in a DataTable displaying the average of [row_count] column, in relation to distinct values in a [process] column.

avg_row_count = CALCULATE( 
AVERAGE('Table1'[row_count]),
ALLEXCEPT('Table1','Table1'[process])
)