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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.