Forum Discussion

sammy02hk's avatar
sammy02hk
Icon for Helper I rankHelper I
3 years ago

Dax SelectedValue With And Condition

Hi there, 

I successed to form a filter with selectedvalue.
However for the screen cap below, the Article 301514200 didn't exist in "Biodegradable" but exist in "Active". The outcome I wish is that the sales record won't appear once I selected both "Active" and "Biodegradable".

 

SelectedNetSales(AND) =
VAR SRecordGRP =
    ALLSELECTED ( 'Assortment Ori'[Record_Group] )
VAR SArt =
    ALLSELECTED ( 'Assortment Ori'[Article_Code] )
VAR SRecord =
    ALLSELECTED (  'Assortment Ori'[Record] )
VAR SDate =
    ALLSELECTED ( 'Assortment Ori'[YearMonth] )

RETURN
    CALCULATE (
        SUMX ( Sales, VALUE ( Sales[NET_SALES] ) ),
        FILTER (
            'Assortment Ori',
               'Assortment Ori'[Record_Group] IN SRecordGRP
               && 'Assortment Ori'[Record] IN SRecord
               && 'Assortment Ori'[YearMonth] IN SDate
        )
    )

Thank you for your help.
Sammy Chu