Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Multiple filter conditions

Hi,

 

I got the table DimCompanyHis (it contains more columns but these are not relevant for the filtering).
company category and company subcategory are textual columns.

Company nameCompany categoryCompany subcategory
A125
B128
C133
D133
E1-
F218
G2-
H2-
I312
J433

 

I need to filter out companies:

1. Company category = "2"
OR
2. Company category = "1" AND Company subcategory = "33"

This is too much for the regular Power BI filter options so I need DAX.
I tried a query with CALCULATEDTABLE but I got the scalar value vs multiple value error.

Any ideas?
Thx in advance!

6 Replies

  • Anonymous try following measure

     

    Your Measure = 
    CALCULATE( SUM(Table[Sales]),
    Company[Company Category]="2" ||
    AND( Company[Company Category] = "1", Company[Compay Subcategory]="33")
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Why the SUM?
      My category and subcategory are textual values (saying this I know that I could have created better example data:-) ).

      • parry2k's avatar
        parry2k
        Super User

        Anonymous sum was just to show how to apply or condition in your measures.