Forum Discussion

ScottBrown's avatar
ScottBrown
Helper II
4 years ago
Solved

DAX Help - Partially created from Time Intelligence

I need filtering this down a little further, Need to filter the weekIndex to be greater than or equal to -20 How do I round the answer = currently is 22.67 which is correct AVG Weekly Productio...
  • AlexisOlson's avatar
    4 years ago

    Is this what you mean?

    AVG Weekly Production Last 20 Wks =
    ROUND (
        AVERAGEX (
            FILTER ( VALUES ( 'DimDates'[weekIndex] ), 'DimDates'[weekIndex] >= -20 ),
            CALCULATE ( COUNT ( 'Production_Stock_OrderLines_HIST-PROD'[txtOrdNo] ) )
        ),
        0
    )