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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
VincenzoDelaVeg
New Member

Creating a Filter to Display All Client Values Based on a Specific Value in PowerBI

This is my first post in the PowerBI community, so apologies if the format isn't perfect. As far as I know, this question hasn't been posted yet.

 

I have a table with client IDs, and each client has specific values. I would like to create a filter that, when I select "Value = B", shows me a table containing the client ID and the values for all clients who have any mention of value B.

 

For example, it would show all values for Clients 1, 2, and 3, but not for Client 4, since Client 4 doesn't have a value of B. I would ideally have a slicer where I can choose 4, so this will allow me to change the value that I need (I have around 500 choices in my table).

 

If I were to write this in SQL, it would look something like the query below. Despite my best efforts, I just can't figure out how to achieve this in PowerBI.

 

 

 

 

select ClientId, Value
from table
where clientid in (select * from table where Value = B)

 

 

 

 

This is the table that I have:

ClientidValue
1B
1C
1D
1F
1G
1I
1J
2B
2E
2F
2H
2I
2J
3A
3B
3D
3F
3H
3J
4A
4C
4E
4G
4I
4J

 

And this is what I am after (ClientId 4 is therefore gone because it does not have the value B)

ClientidValue
1B
1C
1D
1F
1G
1I
1J
2B
2E
2F
2H
2I
2J
3A
3B
3D
3F
3H
3J

 

 

My method so far
I create a copy of the table in DAX and making sure I have distinct values.

 

 

 

 

 

 NewTable = DISTINCT(SELECTCOLUMNS('Table', "Value", 'Table'[Value], "Clientid", 'Table'[ClientId]))

 

 

 

 

 

Then I create a measure that reads from NewTable when select B, and attemps to export the list of ClientID

 

 

 

 

 

Filtered_ClientID = 
CALCULATETABLE (
    DISTINCT('Table'[ClientId]),
    FILTER (
        'Table',
        'Table'[Value] IN VALUES ( 'NewTable'[Value] )
    )
)

 

 

 

 

 

The problem is that (1) I feel like I'm going in circle with my problem and (2) This Filtered_ClientID is throwing an error that there are multple value per column, which is exactly what I am trying to extract. 

 

Thanks a lot! By the way, how come I cannot insert a PowerBI file into the chat... isnt it the PowerBI forum? /s

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

I have answered a similar question in the attached PBI file.

Hope this helps.

Ashish_Mathur_0-1720921747726.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

I have answered a similar question in the attached PBI file.

Hope this helps.

Ashish_Mathur_0-1720921747726.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.