Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Multi Column Filter using DAX or Edit Query

Hi,

 

We can filter multi column using visual level filter in Matrix in power bi.

1.JPG

 

I tried to filter multiple column by using IF functionin DAX and Edit Query. But getting different value.

 

comp vol2 = IF('Table1'[comp status]="pass",1,IF('Table1'[comp status]="fail",1,IF('Table1'[Work Cat]="uw",1,0)))

 

2.JPG

Please find attached .pbix file and let me know is possible to filter multiple column using IF function or any other function or formula.

 

 

 

 

 

https://drive.google.com/file/d/1YsorLAFOHqKZ_aexsP23axkchoucQ_bz/view?usp=sharing

 

Regards,

Salem

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I hope you realise the reason why you are getting 28 in the first visual, is because you did not put the filter condition of comp status = "pass" AND "fail".  Do you want this condition ? If no, simply delete it from the formula.

 

No comp status condition present in the filters sectionNo comp status condition present in the filters sectionAfter putting the comp status filter conditionAfter putting the comp status filter condition

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I think you are trying to count all compvol entries in the table which have comp status as "pass" or "fail" and work cat as "uw". You can try the below.

CompVol2Measure =
CALCULATE (
    COUNTROWS ( Table1 ),
    FILTER (
        Table1,
        Table1[comp status] IN { "pass", "fail" }
            && Table1[Work Cat] = "uw"
    )
)
Anonymous
Not applicable

Hi Nikhil,

 

Thanks for your reply.

 

I have created the measure and found half of expected matrix.

 

3.JPG

 

Please have a look is it possible to make the value 28 instead of 14.

 

Regards,

Salem

Anonymous
Not applicable

I hope you realise the reason why you are getting 28 in the first visual, is because you did not put the filter condition of comp status = "pass" AND "fail".  Do you want this condition ? If no, simply delete it from the formula.

 

No comp status condition present in the filters sectionNo comp status condition present in the filters sectionAfter putting the comp status filter conditionAfter putting the comp status filter condition

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.