Forum Discussion
Return all rows from table matching multiple criteria
- 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.
- 7 years ago
hi, Splyn
You could try this way:
Step1:
Create a measure as below:
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 ))Step2:
Drag fields from Transaction table and measure into table visual.
Of course, you could just drag measure into visual level filter and set it is not blank
By the way, for Ashish_Mathur code, I have applied it into the demo pbix, you could also try it.
Best Regards,
Lin
Because brand B is not in store 2. Results should ONLY include brands from the brand table IF ALL brands from the brand table are within the store.
Let me know if more examples or clarification are required.
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.
- Splyn7 years agoFrequent Visitor
Thanks for the response! For some reason, I cant seem to view the power query code. Could you copy it into this thread?
- Ashish_Mathur7 years ago
Super User
Hi,
Download and open my Excel file. Go to Data > Queries and Connections and in the right hand side pane, right click on the query and Edit.