Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a table of records which is connected to multiple other tables of demographic data. I need to filter the first table to those records which match the filtered records in any of each of the other tables. For example:
Table 1 is
PersonA |
PersonB |
PersonC |
Table 2 is
PersonA | Red |
PersonB | Blue |
PersonC | Green |
Table 3 is
PersonA | Warm |
PersonB | Cold |
PersonC | Hot |
Table 4 is
PersonA | Happy |
PersonB | Bored |
PersonC | Curious |
In this scenario, if a person is "Happy" OR "Hot" OR "Green" then Table 1 should be filtered to those matching records. I then need to apply this filter to multiple visuals, where the measure returns 1 if a record in Table1 matches and returns 0 if a record in Table1 does not match, while the visual-level filter is set to only show values where the measure returns 1.
This is where I'm at right now, the problem is I'm not sure how to actually compare the values in the visuals (which may be a sum/count of records per higher-level category such as Location or Demographic Group) with the values in my calculated single-column table:
Any help would be greatly appreciated, thank you!
Hi @wcarter ,
I’ve made a test for your reference:
1\My Tables:
Table 1
Table 2
Table 3
Table 4
2\Measure
Student_Unduplicated_Filter =
COUNTROWS(Filter('Table 2','Table 2'[Program] IN {"Happy","Hot","Green"} && 'Table 2'[Person]=SELECTEDVALUE('Table 1'[Person])))>0 ||
COUNTROWS(Filter('Table 3','Table 3'[Program] IN {"Happy","Hot","Green"} && 'Table 3'[Person]=SELECTEDVALUE('Table 1'[Person])))>0 ||
COUNTROWS(Filter('Table 4','Table 4'[Program] IN {"Happy","Hot","Green"} && 'Table 4'[Person]=SELECTEDVALUE('Table 1'[Person])))>0
3\Result
Best Regards,
Bof
I have a table of records which is connected to multiple other tables of demographic data. I need to filter the first table to those records which match the filtered records in any of each of the other tables.
All filters are applied by default on top of each other ("AND"). What you want is an "OR" filter - that can only be achieved when you do not link the tables.
Use measures to implement your logic. Use TREATAS to project your filters, or IN for smaller issues.
Show = if ( SELECTEDVALUE('Table 1'[Person]) IN UNION(values('Table 2'[Person]),values('Table 3'[Person]),VALUES('Table 4'[Person])),1,0)
Use that measure as a visual filter
Interesting! Closer I think to what i need, but what if I have a grouping category for my Table1 list?
If Table 1 looks like this:
Person1 | Human |
Person2 | Human |
Person3 | Human |
And I want to get a count of all "Human" who match the conditions of the filter, when I update the file you shared there are no matches and the visual is blank.
Thank you!
You would need to materialize the measure before you can do your count.
That's what I was afraid of, if you can see any way to get the filter to work the way I need please let me know, until then I'll have to create a calculated table and filter using that.
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
76 | |
52 | |
39 | |
35 |
User | Count |
---|---|
92 | |
67 | |
54 | |
52 | |
46 |