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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
DeeBali
Helper I
Helper I

Multiple Filters OR on multiple columns from multiple tables

Hello Fabric Community,

 

I need some assistance in solving a calculation I am attempting. So I am trying to count Name column in one of my tables called "MasterList" based on filters across multiple tables and columns (that all i have relationships to each other). However the logic I need to use is that the calculation counts if either of the filter is true, not when every single filter is true. Here is the code I am using:

NON COMPLIANT = calculate(distinctcount(MasterList[Name]), AD[In SCCM]="No",SCCM[In AD]="No",Defender[Onboarded]="No",Purview[Onboarded]="No", InTune[Onboarded]="No",MasterSecureBaseline[State] ="Yes")

So this gives me a number based on all these conditions being true (which is much lower number than expected). What I am trying to do is count Name column in MasterList table when any of the filters is true (like a OR logic). Please help me! Thank you team! 
1 ACCEPTED SOLUTION

I will have to ask you to provide samples of the MasterList table and at least two of the other participating dimension tables.

 

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

View solution in original post

10 REPLIES 10
lbendlin
Super User
Super User

use ||  or IN   function to achieve that.

Hello,

 

Thank you for your response. I have not used IN funtion prior to this, may I get some hint on how to write this statement? Thank you. 

It doesn't apply in your scenario.  You would use the || operator

 

NON COMPLIANT = calculate(distinctcount(MasterList[Name]), 
                                  AD[In SCCM]="No" || 
                                  SCCM[In AD]="No" || 
                                  Defender[Onboarded]="No" || 

                                  Purview[Onboarded]="No" || 

                                  InTune[Onboarded]="No" || 

                                  MasterSecureBaseline[State] ="Yes")

 

You may need aggregations - depends on your setup.

Hello,

 

I tried this code and the errorI recieve is below:

"The expression contains columns from multiple tables, but only columns from a single table can be used in a True/False expression that is used as a table filter expression."

Fair enough.  In that case do a distinctcount over the Union of these tables.

 

NON COMPLIANT = distinctcount(union(
                                  Filter(Values(MasterList[Name]),AD[In SCCM]="No"), 
                                  Filter(Values(MasterList[Name]),SCCM[In AD]="No"),
                                  Filter(Values(MasterList[Name]),Defender[Onboarded]="No"),

                                  Filter(Values(MasterList[Name]),Purview[Onboarded]="No" ),

                                  Filter(Values(MasterList[Name]),InTune[Onboarded]="No"),

                                 Filter(Values(MasterList[Name]), MasterSecureBaseline[State] ="Yes")
                                ))

Sir, this is the error I recicved:

DeeBali_1-1712868496817.png

 

 

 

fair enough

 

NON COMPLIANT = countrows(distinct(union(
                                  Filter(Values(MasterList[Name]),AD[In SCCM]="No"), 
                                  Filter(Values(MasterList[Name]),SCCM[In AD]="No"),
                                  Filter(Values(MasterList[Name]),Defender[Onboarded]="No"),

                                  Filter(Values(MasterList[Name]),Purview[Onboarded]="No" ),

                                  Filter(Values(MasterList[Name]),InTune[Onboarded]="No"),

                                 Filter(Values(MasterList[Name]), MasterSecureBaseline[State] ="Yes")
                                )))

Hello Sir, thank you for your assistance. Witht his new DAX commands, I get below error:

DeeBali_0-1712869534153.png

 

And for clarification, I did chnage the table name from MasterSecureBaseline to SBMissing as that is table I need to use. I I did do summarization on the State column in the SBMissing table and others as well:

DeeBali_1-1712869659904.png

Thank you. 



 

I will have to ask you to provide samples of the MasterList table and at least two of the other participating dimension tables.

 

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Hello,

Thank you. I was able to get desired results by calculating a SUM on each measure from the table and made a new measure. Thank you for your help. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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