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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
XaviOV
Helper V
Helper V

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.

 

Filter1.png

 

Regards,

 

Xavi

2 ACCEPTED SOLUTIONS

@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.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

@XaviOV  

 

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

This should work.



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

10 REPLIES 10
nandukrishnavs
Community Champion
Community Champion

@XaviOV 

 

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
🙂

 


Regards,
Nandu Krishna

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

@XaviOV  I had modified logic in the previous post.

 

IF('Table'[ID]IN _id,"Yes","No")

 


Regards,
Nandu Krishna

@XaviOV  

 

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

This should work.



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

nandukrishnavs
Community Champion
Community Champion

@XaviOV 

 

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
    _result

Now you can filter this column.



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

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.

 

Filter2.png


Regards,

 

Xavi

@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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler

 

Regards,

 

Xavi

Source data:

IDPreguntaPestaña
AAARVDBUHPValores-HP
AAARVDBULíneaDataKey1508409950520
AAARVDBUNombreDataKey1519315817647
AAARVDBUHora 
AAARVDBUFundidoresValores-fundidores
AAARVDBUCentrífugaValores-centrifuga
AAARVDBUSemana 
AAARVDBUTrabajar fin de semanaDataKey1522249127825
AAARVDBUFecha 
AAARVDBUAño 
AAARUDGIFiltro AguaFiltro-agua
AAARUDGIFiltro EmulgenteFiltro-emulgente
AAARUDGILíneaDataKey1508409950520
AAARUDGINombreDataKey1519315817647
AAARUDGIFiltro EmulgenteDataKey1567402334544
AAARUDGILimpieza completa Filtros PreparaciónDataKey1517842778543
AAARUDGIHora 
AAARUDGISemana 
AAARUDGIFecha 
AAARUDGIAño 
AAARUCFJFotoFoto-cortado
AAARUCFJFiltros GAFResiduos
AAARUCFJLíneaDataKey1508409950520
AAARUCFJNombreDataKey1519315817647
AAARUCFJSelección tanque GAFDataKey1522244698903
AAARUCFJNivel tanque LipsaDataKey1543398759149
AAARUCFJCaudal bombaCaudal
AAARUCFJToneladas filtradasToneladas
AAARUCFJFotoFoto-lateral
AAARUCFJFotoFoto-boca
AAARUCFJ¿Hay cambio de filtro?DataKey1519313871619
AAARUCFJFiltros GAFObservaciones
AAARUCFJFiltros GAFGAF
AAARUCFJHora 
AAARUCFJSemana 
AAARUCFJFecha 
AAARUCFJAño 

 

Output data:

IDPreguntaPestaña
AAARVDBUHPValores-HP
AAARVDBULíneaDataKey1508409950520
AAARVDBUNombreDataKey1519315817647
AAARVDBUHora 
AAARVDBUFundidoresValores-fundidores
AAARVDBUCentrífugaValores-centrifuga
AAARVDBUSemana 
AAARVDBUTrabajar fin de semanaDataKey1522249127825
AAARVDBUFecha 
AAARVDBUAño 
AAARUDGIFiltro AguaFiltro-agua
AAARUDGIFiltro EmulgenteFiltro-emulgente
AAARUDGILíneaDataKey1508409950520
AAARUDGINombreDataKey1519315817647
AAARUDGIFiltro EmulgenteDataKey1567402334544
AAARUDGILimpieza completa Filtros PreparaciónDataKey1517842778543
AAARUDGIHora 
AAARUDGISemana 
AAARUDGIFecha 
AAARUDGIAño 

@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.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
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

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.