Forum Discussion

sgk123's avatar
sgk123
Frequent Visitor
9 years ago
Solved

Weekly Totals

I need to create a column with weekly totals I have different locations and different items selled on different days. I need a column like below   Or else I need a column with weekly average ...
  • Sean's avatar
    9 years ago
    CALCULATE ( SUM (Table[Amount]), ALLEXCEPT ( Table, Table[Week] ) )

    You should add a YYYY-WW column and reference it in the formula not just the week number
  • Sean's avatar
    Sean
    9 years ago
    Weeekly Amount =
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Amount] ),
            ALLEXCEPT ( 'Table', 'Table'[Week], 'Table'[Location], 'Table'[Item] )
        ),
        CALCULATE (
            COUNTA ( 'Table'[Item] ),
            ALLEXCEPT ( 'Table', 'Table'[Week], 'Table'[Location], 'Table'[Item] )
        ),
        0
    )