Forum Discussion

adi38612's avatar
adi38612
Frequent Visitor
2 years ago

Text Filter Facing conundrum!!

I am using Text Filter Visual to filter out values in a table and the SELECTEDVALUE function shows the output based on it.

The input is name of a person in the text filter, and if the name is found then the output, in a separate card, is the name of the person. The measure for the output is:

name_entered =
SELECTEDVALUE('Table 1'[name])

 

It is working for most of the cases. However, when I type in a name like 'John' when there is 'Johnson' or 'Johny' also available, it return blank because SELECTEDVALUE has a property where it returns the value when the context for columnName has been filtered down to one distinct value only, Otherwise returns alternateResult.

Note that it would return available when searched for Johnson or Johny, as there is no conflict (non-distinct values) there.

 

Can I get the desired output on this? I don't want to change the input type, i.e., it has to stay as text filter.

7 Replies

  • adi38612 you can try something like this:

     

    Measure = 
    COCATENATEX ( VALUES ( Table[Name] ), Table[Name], "," )
    • adi38612's avatar
      adi38612
      Frequent Visitor

      Thank you for the response.

      By this, I am getting output as 'Johnson, Johny, John', rather than 'John'

    • adi38612's avatar
      adi38612
      Frequent Visitor

      John is a separate row entry under the column 'name' in the 'Table 1'. Similarly, Johnson and Johny are also separate entries.

      I want that if I enter John in Text filter, I get only John. Right now, I am getting Blank, as John is not treated as distinct entries by SELECTEDVALUE function.

      But when I enter Johnson or Johny, I get them respectivaly as the output as they are treated as Distinct entries.

  • adi38612 I understood your question and that's why I asked what the behaviour should be, assume someone enters "Johns" only, and what would be the return in case there are two values as listed below:

     

    Johnson

    Johnsabc

    • adi38612's avatar
      adi38612
      Frequent Visitor

      In case, user searches for anything that is not available in the column 'name', it should return a 'blank' only.
      So if only John, Johnson and Johny are there in the table, and if I search for johns, it should return a 'blank'.

       

  • adi38612 don't think there is a going to a solution for this if you are using a Text filter because there is no way to compare the value entered by the user. You are out of luck my friend.