The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Dear community,
I'm trying to figure out how to exclude the rows for a specific ID, in a column of a Join table.
The table has this code:
I need help to remove from UDM_DMO_SPOT_VALOR table, "ID Spot",UDM_DMO_SPOT_VALOR[ID_SPOT], the ID=30 (i.e. UDM_DMO_SPOT_VALOR[ID_SPOT]<>30).
Any tip on this?
Thanks in advance.
Regards
Solved! Go to Solution.
Hi @Anonymous - you can use FILTER on the output of SELECTCOLUMNS to remove rows prior to the UNION happening.
FILTER ( SELECTCOLUMNS (...), [Filter Condition] )
You could also potentially use FILTER inside SELECTCOLUMNS by first filtering the base table, then choosing the columns
SELECTCOLUMNS ( FILTER ( [Table], [Filter Condition] ), ... )
Hope this helps
David
FILTER( TableName, NOT(TableName[ID_FW] IN {"xx", "yy", "zz"} ) )
should work (obviously if the IDs are numbers, don't need the quotes). If it isn't please share your error message or what behavior you are seeing.
Hope this helps,
David
Hi @Anonymous - please reread my initial response to your post. You are not following the pattern I suggested. See https://dax.guide/filter/ , https://dax.guide/selectcolumns/ and https://dax.guide/union/ for proper syntax.
You should also use a tool like https://www.daxformatter.com/ to make your code readable. It will also tell you if your code has a syntax error (though it won't necessarily tell you what the error is). I can't get your code as written to compile on daxformatter so there are issues with it that need to be resolved.
Hope this helps
David
FILTER( TableName, NOT(TableName[ID_FW] IN {"xx", "yy", "zz"} ) )
should work (obviously if the IDs are numbers, don't need the quotes). If it isn't please share your error message or what behavior you are seeing.
Hope this helps,
David
@dedelman_clng Yes, you're right. I have reordered the code and it worked.
Thanks for your tips!
Cheers!
@dedelman_clng thanks for your tip, first of all. I've tried this one (in blue):
Thanks @dedelman_clng! It worked. I tryied Filter function before, but it was not properly written in the DAX code.
Cheers!
Hi @dedelman_clng! Hope you're fine.
One more question if you can help:
Instead of one ID that I need to filter, I need 2 or more ID to be out of the table, what do you think will be the best option?
I've tryed NOT [ID_FW] {xx,yy,zz}, but it didn't work.
Any tip on this?
Thanks in advance
Regards
Hi @Anonymous - you can use FILTER on the output of SELECTCOLUMNS to remove rows prior to the UNION happening.
FILTER ( SELECTCOLUMNS (...), [Filter Condition] )
You could also potentially use FILTER inside SELECTCOLUMNS by first filtering the base table, then choosing the columns
SELECTCOLUMNS ( FILTER ( [Table], [Filter Condition] ), ... )
Hope this helps
David
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
20 | |
17 | |
15 | |
13 |
User | Count |
---|---|
42 | |
36 | |
23 | |
22 | |
17 |