Forum Discussion

hummingbird's avatar
hummingbird
Helper II
2 years ago

Hide Client Names when Client Selected

Hi all, a very exciting question that has previously been discussed but I could not find a defined solution.

 

I have a relatively extensive table with client data that I want to visualise and compare each client side by side, here is a simplified snapshot:

 

NameValue
Albert232
Mark5224
Hannah245

 

Is there any method that will allow me to select the customer name on the slicer and it will hide the names of other customers, but the one(s) selected? For example, if Hannah is selected, the graph and visuals will look like this:

 

NameValue
Other Client232
Other Client5224
Hannah245

 

Thank you.

9 Replies

  • hummingbird are you going to slice the data by another dimension as well, or just customer selection is the requirement?

    • hummingbird's avatar
      hummingbird
      Helper II

      Potentially by other dimensions / columns in the table but there always will be a Client slicer that defines which names to show. If nothing selected then show all names.

    • CoreyP's avatar
      CoreyP
      Solution Sage

      parry2k & hummingbird,

       

      Do you mean something like this? 

       

      I did this by creating a measure like so:

      Selected Client = 
      SWITCH(
          TRUE() ,
          AND( HASONEVALUE( Clients[Client] ) , SELECTEDVALUE( Clients[Client] ) = SELECTEDVALUE( ClientData[Name] ) ) , SELECTEDVALUE( ClientData[Name] ) ,
          AND( HASONEVALUE( Clients[Client] ) , SELECTEDVALUE( Clients[Client] ) <> SELECTEDVALUE( ClientData[Name] ) ) , "Other Client" ,
          SELECTEDVALUE( ClientData[Name] )
      )

       

      As it's using a measure to display the client's name ( an axis value ), the visual needs to know which client is being selected on the row. You can use an ID field to add the context needed by the visual without supplying a hard name value. Your slicer would then reference a table of client names that is disconnected from the model, i.e) no relationship to your fact table.

       

      • hummingbird's avatar
        hummingbird
        Helper II

        This is exactly what I am refering to, thank you. However, I cannot use this measure in the bar chart and when I select a name, the full list of customers (even with no data in the given period) is pulled up.

    • hummingbird's avatar
      hummingbird
      Helper II

      parry2k I have around 1k distinct customers that vary throughout months of the year. Ideally I only want to be able to select customers that have purchased in the given period - defined by the period slicer

  • CoreyP Indeed this is a great solution but I wanted to avoid the measure in case this needs to be used in a matrix visual or some other places as a column and that was the reason I asked the number of unique clients to come up with a solution. I had a working copy based on the model (not measure) but waiting on the OP's reply.

     

    Great solution though. Cheers!!

    • CoreyP's avatar
      CoreyP
      Solution Sage

      Oh, fascinating! I'd like to see what you came up with. I'm guessing it leverages What-If Parameters?