Forum Discussion

sobsawats's avatar
sobsawats
Frequent Visitor
9 years ago
Solved

SUM only same product UoM

Hi all, I have transaction of product and its multi level product group, each product line has quantity which I want to sum it to its uppler product group. The condition of sum is if product has sam...
  • v-chuncz-msft's avatar
    9 years ago

    sobsawats,

     

    You may add measures as follows.

    QTY2 =
    IF ( DISTINCTCOUNT ( txn[UNIT] ) = 1, SUM ( txn[QTY] ), 0 )
    
    UNIT2 =
    IF ( DISTINCTCOUNT ( txn[UNIT] ) = 1, MAX ( txn[UNIT] ), "NA" )