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.
Hello,
I'm looking to exclude 100's of values out of a column in my Query (UserID column) and am wondering the best way to do this. Every value in the UserID column is unique so manually filtering out would not be possible, and there is no other column where they will all have common values which I can filter on instead.
The data comes directly from a SQL database and I can't manipulate the data before it arrives in Power BI.
I have a list of the UserIDs I need excluding which I can import as a CSV into PowerBI if I can utilise this.
Does anyone have any ideas?
Thank you in advance.
you can do after select the source data and enter the code to exclude the values you what.
or in edit query filter the column with some conditional
Hi @santiagomur ,
Thanks for the response but the problem is that I have 100's of values I want to exclude. I had considered both the options you have posed but don't want to have to tell the query editor / SQL database to exclude for example userid '00001' and '00019' and '00104' etc etc.... for 100's of values.
Is there an easier way this can be done based on an existing list of userids I need excluding?
Thank you.
Hi @Anonymous
you can write a parametrized query that dynamcally references your list like described here:
https://community.powerbi.com/t5/Desktop/Parameterized-SQL-Query-with-query-folding/td-p/171503
Just change to WHERE ... NOT IN..
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |