Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
sammy02hk
Helper I
Helper I

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".

sammy02hk_0-1691487359501.png

 

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
2 REPLIES 2
johnt75
Super User
Super User

There's a good article and video on using AND logic for slicers at https://www.sqlbi.com/tv/apply-and-logic-to-multiple-selection-in-dax-slicer/ 

Thank you for your help. Let have a look.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.