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
SamOvermars
Helper I
Helper I

Filtering visual based on a list?

Hello,

I have a visual that I need to filter it based on a list of values.

for example a line chart that will calculate all the customer IDs but not the IDs that are coming from a specific list. I tried to add the ID column to the filters pane and using the advanced filter select ( is not ) and picked the ID but the problem is that I have about 20 ID and some of them are not in the table yet. 

So how can I approach this?

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@SamOvermars  What do you mean 'some of them are not in the table yet'? Not sure how to filter for NOT ID if it's not there yet, but I think you might find a Left Anti merge to be helpful, if you don't mind the filter being applied at power Query level?

 

If you have a list of all the IDs you don't want in a table, and you have the Customer table, then in Power Query you can start with the Customer table, Merge Queries > select Customer ID columns in both tables. Then choose Left Anti for your Join kind. That will remove any Customer ID that was in the Second table list, and keep all other customer IDs that were not in that second list.

 

When you create your visuals, just filter to remove Blank Customer ID, as those will be related to the customers you filtered out in Power Query.

 

Does that make sense hopefully?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @SamOvermars 

Hope you are doing well.

 

Have you solved this question? Can we close this thread now if there is no other question? It would be nice if you can accpet my answer as the solution. Thanks 🙂

 

 

Best Regards,

Community Support Team _Tang

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

v-xiaotang
Community Support
Community Support

Hi @SamOvermars 

Thanks for reaching out to us.

Is the visual you are looking for? https://blog.pragmaticworks.com/power-bi-custom-visuals-filter-by-list

 

FYI:

https://community.powerbi.com/t5/Desktop/Filter-by-List-by-Dev-Scope-is-gone/td-p/1164066

 

 

Best Regards,

Community Support Team _Tang

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

AllisonKennedy
Super User
Super User

@SamOvermars  What do you mean 'some of them are not in the table yet'? Not sure how to filter for NOT ID if it's not there yet, but I think you might find a Left Anti merge to be helpful, if you don't mind the filter being applied at power Query level?

 

If you have a list of all the IDs you don't want in a table, and you have the Customer table, then in Power Query you can start with the Customer table, Merge Queries > select Customer ID columns in both tables. Then choose Left Anti for your Join kind. That will remove any Customer ID that was in the Second table list, and keep all other customer IDs that were not in that second list.

 

When you create your visuals, just filter to remove Blank Customer ID, as those will be related to the customers you filtered out in Power Query.

 

Does that make sense hopefully?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.