Forum Discussion

JamesBurke's avatar
JamesBurke
Helper III
2 years ago
Solved

Daily Average

Hi all ,      Daily Average all = CALCULATE( AVERAGEX( VALUES('Date'[Day ID]), [Total Kwh] ),ALL('Date'))     Above Is the Dax forumla i'm using as a average of all days and then comp...
  • DataInsights's avatar
    2 years ago

    JamesBurke,

     

    Try a measure like this. You could use ALLSELECTED instead of ALL if you want a date slicer/filter to apply to the calculation.

     

    Daily Average by Day Name =
    VAR vTable =
        CALCULATETABLE (
            VALUES ( 'Date'[Date] ),
            ALL ( 'Date' ),
            'Date'[Day Name] = MAX ( 'Date'[Day Name] )
        )
    VAR vResult =
        AVERAGEX ( vTable, [Total Kwh] )
    RETURN
        vResult