cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hwang
Regular Visitor

DAX- Multi-Filtering criteria (A AND B) OR (C AND D)

Dear Experts,

 

In DAX i need to filter with condition account operation group (A & B) OR account operation group (C & D).

But, the codding doesn't seems working. Could you advise me how to fix this DAX codding? Many Thanks in Advance.

 

Measure = CALCULATE([USDAmount],FILTER(FILTER(Account, Account[AccountGroup]="A"|), FILTER('Operation Report','Operation Report'[OperationReportAccount]="B")) || FILTER(FILTER(Account, Account[AccountGroup]="C"|), FILTER('Operation Report','Operation Report'[OperationReportAccount]="C")).

 

Account group & operation report account are from differerent column & different table (1 from account, 1 from operation report).

 

Let me know if you have any idea on this.

 

Many thanks 😉

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-danhe-msft
Microsoft

Re: DAX- Multi-Filtering criteria (A AND B) OR (C AND D)

Hi @Hwang,

Based on my test, you could refer to below formula:

Sample data:

1.PNG

Create a calculated table:

Table = CALCULATETABLE('Table1',FILTER(Table1,OR(Table1[AccountGroup]=41 && Table1[OperationReportAccount]=197,(Table1[AccountGroup]=47 && Table1[OperationReportAccount]=198))))

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
LivioLanzo Solution Sage
Solution Sage

Re: DAX- Multi-Filtering criteria (A AND B) OR (C AND D)

Hi @Hwang

 

are you able to post a sample of your tables? thx

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Hwang
Regular Visitor

Re: DAX- Multi-Filtering criteria (A AND B) OR (C AND D)

@LivioLanzo Hi Livio, below is the table example.

AND OR_Multiple Criteria.jpg

I need to filter USDAmount column only for (Account Group= 41 - AND - Operation Report Account=197) OR (Account Group 47- AND- OperationReportAccount =198)

 

Please advise me the DAX coding. I have tried coding as per my prev. post but it doesn't work.

 

Thanks,

 

 

 

 

Super User I
Super User I

Re: DAX- Multi-Filtering criteria (A AND B) OR (C AND D)

@Hwang Please try to post the sample data in copiable format. I guess you are looking for subset of this table based on the filter criteria mentioned. Please try this as a "New Table"

 

NewSubset = FILTER(TableName,OR((TableName[AccountGroup]=41 && TableName[OperationReportAccount]=197),(TableName[AccountGroup]=47 && TableName[OperationReportAccount]=198))


Did I answer your question? Mark my post as a solution !

Proud to be a Datanaut !





Microsoft v-danhe-msft
Microsoft

Re: DAX- Multi-Filtering criteria (A AND B) OR (C AND D)

Hi @Hwang,

Based on my test, you could refer to below formula:

Sample data:

1.PNG

Create a calculated table:

Table = CALCULATETABLE('Table1',FILTER(Table1,OR(Table1[AccountGroup]=41 && Table1[OperationReportAccount]=197,(Table1[AccountGroup]=47 && Table1[OperationReportAccount]=198))))

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Microsoft v-danhe-msft
Microsoft

Re: DAX- Multi-Filtering criteria (A AND B) OR (C AND D)

Hi @Hwang,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors