Latest Enterprise DNA Initiatives

Correct Volume Required for selected slicer

Hi,

I am not getting correct volume while selecting slicers in below attached screenshot; I should be getting volume of “PQR” brand (from red colored box) in “Companies Meeting both condition” table (yellow highlighted numbers". Basically the file shows what particular product has been bought and what has not AND the volume of product bought.
You may follow following thread too if there is an issue in query.


eDNA Forum - Bought and Not Bought Solution2.pbix (40.1 KB)

Hi @harishrathore,

Please see if this meets your requirement.
It leverages the same logic for the [Bought and Not Bought] measure created by @BrianJ

Volume Bought = 
VAR _Bought1 =
    CALCULATETABLE(
        VALUES( Customers[Company]),
        FILTER(
            ALL( Data ),
            Data[Brand Name] = [Harvest Bought] 
        )
    )
    
VAR _Bought2 = 
    CALCULATETABLE(
        VALUES( Customers[Company]),
        FILTER(
            ALL( Data ),
            Data[Brand Name] = [Harvest Not Bought]
        )
    )
    
VAR _FirstNotSecond =
    CALCULATETABLE(
        VALUES( 'Customers'[Company] ),
        FILTER(
            'Customers',
            'Customers'[Company] IN _Bought1 &&
            NOT ( Customers[Company] IN _Bought2 )
        )
    )
RETURN

CALCULATE( SUM( Data[Volume] ),
    TREATAS( VALUES('Disconn Bought'[Brand Name Bought]), Data[Brand Name]),
    TREATAS( VALUES('Disconn Bought'[Segment Bought] ), Data[Segment]),
    _FirstNotSecond
)

I hope this is helpful

1 Like

Hi @Melissa . Can you please share the file? I have put the DAX shared by you in my file but I am not getting desired result. Volume is still not correct.

Regards

Hi @harishrathore,

Sure, here you go.
eDNA Forum - Bought and Not Bought Solution2.pbix (40.2 KB)

Are you testing in your sample file?
If it doesn’t get you the expected results, please share a mock up with the desired outcome.

Hi @harishrathore, did the response provided by @melissa help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query. Thanks!