Forum Discussion

Splyn's avatar
Splyn
Frequent Visitor
7 years ago
Solved

Return all rows from table matching multiple criteria

I have a fact table containing sales data of product broken out by store and brand. I have another table containing a list of brands that I wish to retrieve from the fact table. What im trying to do ...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    7 years ago

    Hi,

     

    Thank you for clarifying and sorry about not reading your question clearly in the first place.  You had alredy clarified my question in your original post.  You may view my Power Query solution in this Excel workbook.  The same can be done in Power BI dektop as well.

     

    Hope this helps.

     

  • v-lili6-msft's avatar
    7 years ago

    hi, Splyn

    Measure = VAR _table=VALUES(Brand[Brand])
    var _table2=CALCULATETABLE(VALUES('Transaction'[Brand]),ALLEXCEPT('Transaction','Transaction'[Store])) return
    CALCULATE(COUNTROWS('Transaction'),FILTER('Transaction', COUNTROWS(EXCEPT(_table,_table2))=0&&'Transaction'[Brand] in _table
    ))

     

     

     

     

     

    Best Regards,
    Lin