Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Filter based list to use for calculation

Hi All, I have scenario that I need to have sum(discount_amt) only for customers which has certain filter applied on it. I have query which gives me data customer wise discount applied., Now 1. I h...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Anonymous,

     

    You can try to use below measure to use the filtered result as the parameter to filter on original table:

    Multi-filter result =
    VAR filtred =
        CALCULATETABLE ( VALUES ( 'Sample'[Cust Id] ), ALLSELECTED ( 'Sample' ) )
    RETURN
        SUMX ( FILTER ( ALL ( 'Sample' ), [Cust Id] IN filtred ), [Disc Amount] )
    

     

    Regards,

    Xiaoxin Sheng