Forum Discussion

Stevo164's avatar
Stevo164
Regular Visitor
8 years ago
Solved

selective sum

Hello everybody, i have the following table SALES that shows the sales per department . COD_STORE DES_STORE COD_DEPARTMENT DES_DEPARTMENT SALES DATE 0002 STORE_1 0002051 DEPARTMENT_1...
  • Stevo164's avatar
    8 years ago

    I solved it creating the following measures:

    • Check_tot1= CALCULATE(COUNT('Sales'[Sales]);'TRANSCODING_DEP_SEG';'TRANSCONDING_DEP_SEG'[CONDITION_RED]="1")
    • Sales_Dep13= CALCULATE(SUM('SALES'[SALES]);'SALES'[DES_DEPARTMENT])="13")

     

    Whit the two new measures I've finally created the measure that can solve my problem:

    • Sales_Seg = IF('SALES'[Check_tot1]>0;'SALES'[Sales_Dep13];SUM('SALES[SALES]))

     

    Thanks everyone for the support.