Search code examples
daxpowerpivot

Powerpivot how to sum value from tables (n:1:n)


enter image description here

Hello all, I'd like to pivot table:

Market PROD_COD sum(Value)

I have no idea how to write dax. Thanks in advance

I've tried CALCULATE(sumx(plus,plus[Value]),prod[PROD_COD]) but it dosent work.


Solution

  • Try:

    TotalV:=
      CALCULATE(
        SUM(YM_Sales[Value]),
        TREATAS(VALUES(mkt_prod[PROD_COD]), 'YM_Sales'[PROD_COD])
      )