Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

DAX: sum with two filters

Hi all,   I am trying to make a new measure 'SalesWest' in Power BI Desktop but I can not make it work.   The situation: there are two tables, Table 1 (factSales) and a related Table 2 (dimStores...
  • Sean's avatar
    10 years ago

    Anonymous Here's the Measure I would use :smileyhappy:

     

    West Sales (Qty NOT 2) MEASURE = 
    CALCULATE (
        SUM ( factSales[amount] ),
        FILTER ( factSales, factSales[storeid] = 1 && factSales[quantity] <> 2 )
    )

     

    However the way you ask the question it seems you want to filter each table separately???

     

    West Sales (Qty NOT 2) MEASURE 2 = 
    CALCULATE (
        SUM ( factSales[amount] ),
        FILTER ( dimStores, dimStores[name] = "West" ),
        FILTER ( factSales, factSales[quantity] <> 2 )
    )

     

    Both of these Measures should work :smileyhappy: