Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Filter table using SELECTEDVALUE and FIND functions

Hi,

I am trying to filter out the table and I have the below data:

With the above data, I have created the below bar chart in which I have set the "Branch" filter to CS:

Now if I click on the AB bar, I should get the below output:

I am getting the desired result if I am passing the Branch name manually like this:

Measure2 = INT(FIND("AB",MAX(students[Name]),1,0) >0)


but if I pass the selected value measure which in Measure 2:

 

Measure1 = SELECTEDVALUE(students[Name])

Measure2 = INT(FIND([Measure1],MAX(students[Name]),1,0) >0)

 

after this I am getting the below output which is a blank table:

can anybody tell me what I am doing wrong here and how I can achieve the desired output?

amitchandak 
AllisonKennedy 

parry2k 

lbendlin 

7 Replies

  • Anonymous , Based on what I got.

    In power query duplicate column Name and split into two columns using Split 

     

    Or create new column in Dax

     

    _1  = left([Name],2)

    _2 = right([Name],2)

     

    then you can use the first column to drill to current name column

    • Anonymous's avatar
      Anonymous
      Not applicable

      Above dax is not working. Giving the below error:

      amitchandak and I can't put 2 get only 1st two chars. It can be of any length.

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , I think you are creating a measure not a column. I suggested a column

         

        If this does not help
        Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • Anonymous check this video my youtube channel which address the similar problem, tweak the solution as you see fit.

     

    https://youtu.be/zS1IDl3DLak

     

     

    Follow us on LinkedIn and  to our YouTube channel

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • Anonymous's avatar
      Anonymous
      Not applicable

      It didn't work out.

  • Anonymous it is very hard to know what you tried, what is not working? A simple reply "it didn't work out" doesn't help with anything.