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

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
v-danhe-msft
Employee
Employee

Hi @Anonymous,

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
v-danhe-msft
Employee
Employee

Hi @Anonymous,

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.
v-danhe-msft
Employee
Employee

Hi @Anonymous,

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.
LivioLanzo
Solution Sage
Solution Sage

Hi @Anonymous

 

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!  

Anonymous
Not applicable

@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,

 

 

 

 

@Anonymous 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 PBI Community Champion




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.