Forum Discussion
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:
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!
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-Forum/ba-p/963216
10 Replies
- lbendlinSuper User
use || or IN function to achieve that.
- DeeBaliHelper I
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.
- lbendlinSuper User
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.