Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
2 months ago
Solved

% by Week and Group

Hi can anyone help me on my calculated column. On my table i want to get the % by Group each week. Sample the group QQQQQ123 on Week 21 it has a count of 4 and RCVD STOCK of 3 4-3/4 = 25.00% ...
  • ryan_mayu's avatar
    2 months ago

    AllanBerces 

    is this what you want?

     

    column =
    Var _stock=CALCULATE(sum('Table'[RCVD STOCK]),ALLEXCEPT('Table','Table'[Group],'Table'[% WEEKLY]))
    var _count=CALCULATE(sum('Table'[COUNT]),ALLEXCEPT('Table','Table'[Group],'Table'[% WEEKLY]))
    return DIVIDE(_count-_stock,_count)