Forum Discussion
Filter text 2 columns
Hi!
I have a table with differents columns.
I want to filter by data of column "Pregunta", for example "Fundidores" or "Filtro Emulgente", and with theese filter I want to save the data of the rows that have the same ID (ID is random). I attachment a picture.
Regards,
Xavi
XaviOV OK, the code I provided earlier seems like it is doing exactly what you are asking or else I am missing something. See attached PBIX file.
FilterColumn = VAR _id = SUMMARIZE ( FILTER ( 'Table', 'Table'[Pregunta] IN { "Fundidores", "Filtro Emulgente" } ), 'Table'[ID] ) VAR _result = IF ( 'Table'[ID] IN _id , "Show", "Hide" ) RETURN _resultThis should work.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
10 Replies
- Greg_Deckler
Community Champion
Perhaps:
New Table = VAR __IDs = SELECTCOLUMNS( FILTER('Table',[Pregunta] = "Fundidores" || [Pregunta] = "Filtro Emulgente"), "ID", [ID] ) VAR __Table = FILTER('Table','Table'[ID] IN __IDs) RETURN __Table - nandukrishnavs
Community Champion
Create a calculated column
FilterColumn = VAR _id = CALCULATE ( DISTINCT ( 'Table'[ID] ), 'Table'[Pregunta] IN { "Fundidores", "Filtro Emulgente" } ) VAR _result = IF ( 'Table'[ID] IN { _id }, "Show", "Hide" ) RETURN _resultNow you can filter this column.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- XaviOV
Helper V
Hi nandukrishnavs and Greg_Deckler
Thanks for you reply, but I want to that ID of "Fundidores" and "Filtros Emulgente" in the rest of lines that same ID that "Fundidores" and "Filtros Emulgente". Attached image the result of what I want.
Regards,Xavi
- Greg_Deckler
Community Champion
XaviOV OK, all the color stuff going on is not helping. You need to do this:
1. Post a sample of your source data as text. Use the table feature in the bar
2. Post what you want as output. Just the rows that correspond to the sample source data that you want in the output
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- nandukrishnavs
Community Champion
Could you try this
FilterColumn = VAR _id = SUMMARIZE ( FILTER ( 'Table', 'Table'[Pregunta] IN { "Fundidores", "Filtro Emulgente" } ), 'Table'[ID] ) VAR _result = IF ( 'Table'[ID] IN _id , "Show", "Hide" ) RETURN _result
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- XaviOV
Helper V
Hi nandukrishnavs
When I'm doing you formula, under the formula appear this message
"A table of multiple values was supplied where a single value was expected."
Regards,Xavi
- nandukrishnavs
Community Champion