Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dax help!

Been trying to write a dax to find the Average of Value column grouped by Beverage type and Country.

I have tried these 3 approaches below

AvgConsumption = GROUPBY('Table','Table'[Beverage Type],"avg",AVERAGE('Table'[Value])) 
AvgConsumption  = GROUPBY('Table','Table'[Beverage Type],'Table'[Country],"Avg",AVERAGEX('Table','Table'[Value]))
AvgConsumption = CALCULATE(AVERAGE('Table'[Value]),GROUPBY('Table','Table'[Beverage Type],'Table'[Country]))
  • Hi Anonymous 

    you can create a measure with ALLEXCEPT()

    AvgConsumption = CALCULATE(AVERAGE('Table'[Value]), ALLEXCEPT('Table', 'Table'[Beverage Type], 'Table'[Country]) )

1 Reply

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    you can create a measure with ALLEXCEPT()

    AvgConsumption = CALCULATE(AVERAGE('Table'[Value]), ALLEXCEPT('Table', 'Table'[Beverage Type], 'Table'[Country]) )