Forum Discussion

XaviOV's avatar
XaviOV
Icon for Helper V rankHelper V
6 years ago
Solved

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

  • nandukrishnavs's avatar
    nandukrishnavs
    6 years ago

    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
    🙂

10 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity 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's avatar
    nandukrishnavs
    Icon for Community Champion rankCommunity 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
    🙂

  • nandukrishnavs's avatar
    nandukrishnavs
    Icon for Community Champion rankCommunity 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
    🙂

     

    • XaviOV's avatar
      XaviOV
      Icon for Helper V rankHelper 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