Forum Discussion

alpcoker's avatar
alpcoker
New Member
9 years ago

Slicer With Selected Terms AND'd Not OR'd

Hello,

 

I am using Attribute Slicer custom visual but as they said: All selected terms are OR'd together. AND is not an available option currently.  

 

Are there any workaround for these situation ?  I am using SSAS live connector.  I could use standard slicer or use multiple slicer (put 3 slicer to be and'd), duplicate dimension or different type of relation.

 

For that example I want to get tweets that contains #SQL and #PowerBi

 

 

Thanks,

5 Replies

  • MattAllington's avatar
    MattAllington
    Icon for Community Champion rankCommunity Champion

    A slicer is used on a column. E.g., the adventure Works database has a column called category, with possible values bikes, clothing, accessories and categories. If the slicer was a logical and, it would be like saying "show me all products that are both a "Bike" and also "clothing". It is impossible to be both, so a logical and would always return nothing. Given this, I don't understand the use case for a logical and using a slicer on a column. 

    Spoiler
     
    • alpcoker's avatar
      alpcoker
      New Member

      Thank you for your attention.

       

      There isn't any example of that on AdventureWorks DW. But I can try to explain my use case with twitter dataset used on example of Attribute Slicer Custom Visual.

       

      Hashtags

      HashtagKeyHashtagText
      1#SQL
      2#PowerBI

       

      Tweets

      TweetKeyTweet Text
      1#SQL 2016 SP1 is out
      2#PowerBI Desktop November update released
      3#PowerBI on premise only works with #SQL Analysis Service live query for now. 

       

       

      IntermediateTable 

      TweetKeyHashtagKey
      11
      22
      31
      32

       

       

      If I select single hashtag there is no problem but if I select #SQL and #PowerBI with slicer or attribute slicer I will get all tweets. (1,2,3). But in my case I just want to list only tweet #3 that contains #SQL and #PowerBI together.

       

      Thanks,

      • MattAllington's avatar
        MattAllington
        Icon for Community Champion rankCommunity Champion

        You therefore need to write a measure that returns a non blank result when your pattern is matched.  In your sample data, something like this

         

        =if(distinctcount(table[hashtagkey])=distinctcount(table[tweetkey]),1)