Forum Discussion

amtbew's avatar
amtbew
Helper I
2 years ago
Solved

Summarizing AND Logic from Slicer

I have a dataset that I'm using a slicer to filter AND Logic using the dax and methodology applied from this blog post - https://community.fabric.microsoft.com/t5/Community-Blog/Apply-AND-logic-in-th...
  • danextian's avatar
    danextian
    2 years ago

    I'm hoping this  one works:

    Comparison 3 = 
    VAR __VENDOR_COUNT =
        COUNTROWS ( 'Vendor ID Table' )
    RETURN
        CALCULATE (
            SUMX (
                SUMMARIZE (
                    Data,
                    Data[Product ID],
                    "CountNo",
                        CALCULATE (
                            DISTINCTCOUNT ( Data[Vendor ID] ),
                            ALLEXCEPT ( Data, Data[Product ID] ),
                            Data[Vendor ID] IN VALUES ( 'Vendor ID Table'[Vendor ID] )
                        )
                ),
                IF ( [CountNo] = __VENDOR_COUNT, 1 )
            ),
            FILTER ( Data, Data[Vendor ID] IN VALUES ( 'Vendor ID Table'[Vendor ID] ) )
        )