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
xhulioberberi
Frequent Visitor

Filter the data using multiple values in different tables.

Hello guys,

thank you very much for your work here it is very helpfull for all of us. I have been working a while with a project to filter data between different tables using different values. 

I have connected two tables between each others that filter data between a same column value. Now what I want to do is to extract data from the table but I don't all of the results but I want to have some of them with some values I want for example: 

The username is from a different table and is connected with the other table and give the results in the left. Now what I want is to filter the data maybe with a measure or something else that to give me the results of all the usernames that have the activity LIM, TOR, VAR as in example and exclude all the others that can have two of them or one. 

 

Thank you very much I hope I have explained somehow in a good way.

Screenshot 2022-09-22 134806.png

1 ACCEPTED SOLUTION

Hi @xhulioberberi ,

 

Please try following DAX to create a measure:

DistinctCount = CALCULATE(DISTINCTCOUNT('Table2'[Activity]),FILTER(ALL('Table2'),'Table2'[ID] = SELECTEDVALUE('Table2'[ID])))

 

The result you want:

vyadongfmsft_0-1664267564468.png

 

Best regards,

Yadong Fang

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

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @xhulioberberi,

 

Test table1:

vyadongfmsft_0-1663900348144.png

 

Test table2:

vyadongfmsft_1-1663900371111.png

 

Relationship between two tables:

vyadongfmsft_2-1663900428223.png

 

Create a measure:

 

Count_username = COUNT('Table1'[Username])

 

 

Put the measure into "Filters" - "is greater than 2" - "Apply filter"

vyadongfmsft_5-1663900577589.png

Result you want:

vyadongfmsft_6-1663900661321.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-yadongf-msft . Thank you very much for your reply. I appreciate it too much. The table I have created is a sample of what I am working for and I am using big data in my project. What I was trying to explain is that I want to filter all the persons in the username table that have the activity "LIM" "TOR" and "VAR". Sorry maybe I have not explained well and will try to explain again with more examples as below:
Screenshot 2022-09-26 091923.png

 

So the first table is a filtered table in one Visualization between two other tables. What I want to achieve is that I want to filter maybe with a measure all of the users that have the activity "LIM" "TOR" and "VAR". So based on this activity I want to get all the user that have this three activity. It might happen that one user have the same activity twice so and doesnt have the third one, so your filter will show him up because it measures the users that have show 3 times.

Thanks again for your time.

Hi @xhulioberberi ,

 

Please try following DAX to create a measure:

DistinctCount = CALCULATE(DISTINCTCOUNT('Table2'[Activity]),FILTER(ALL('Table2'),'Table2'[ID] = SELECTEDVALUE('Table2'[ID])))

 

The result you want:

vyadongfmsft_0-1664267564468.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.