Forum Discussion

Nepal101's avatar
Nepal101
Helper III
2 years ago
Solved

Calculating average based on different column.

Hello Everyone,  I hope to get some help on this DAX or any idea on how to solve this issue. Below is just an example of the data.  I created a column that would do some average  Avgwithincolumn ...
  • Daniel29195's avatar
    Daniel29195
    2 years ago

    Nepal101 

    var c = table_name[Customer]
    var s = table_name[salesperson]
    var g = table_name[group]
    var an = table_name[account number]
    
    return
    averagex ( 
         filter(
            summarize( 
               table_name,
                table_name[Customer],
                table_name[salesperson],
                table_name[group],
                table_name[account number],
               table_name[avg]
    
            ),
    table_name[Customer] = c && 
    table_name[salesperson] = s &&
    table_name[group] = g &&
    table_name[account number] = an 
    ),
    
    table_name[avg]
    
    )

     

     

    let me know if it works for you . 

     

     

     

     

     

    If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
    It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

     

     

     

    CustomerSalespersonGroupaccount numberavgDate