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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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