Forum Discussion

ashishshahs's avatar
ashishshahs
New Member
5 years ago
Solved

Calculate and Lookup values from Static Table

Greetings All,   I have a data model, that stores NetMargin Amount, Sales Person, Customer per week. So, in short, have multiple values for the year (52 weeks). I have a need to calculate the commi...
  • amitchandak's avatar
    amitchandak
    5 years ago

    ashishshahs , Try a measure like

     

    sumx(summzarize(Table, Table[Customer], Table[Week], "_1", calculate(sumx(filter(Table, [margin Sum] >=min(commission[Lower]) && [margin Sum] <=max(commission[Upper])), [margin Sum]*max(commission[Commission])))),[_1])

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi ashishshahs ,

     

    Check the formula below.

    Column = 
    var summargin = CALCULATE(SUM('Sales'[Margin]),ALLEXCEPT('Sales','Sales'[Week],'Sales'[Sales]))
    var commiss = CALCULATE(MAX('commission'[Commission]),FILTER('commission','Sales'[Margin]>'commission'[Lower]&&'Sales'[Margin]<='commission'[Upper]))
    return
    summargin*commiss

    Result would be shown as below.

     

     

    Best Regards,

    jay