Forum Discussion

msl088's avatar
msl088
Frequent Visitor
6 years ago

Select column based on slicer

Hello,

 

I have a situation where I want to filter an entire table based on a slicer selection. I have created 7 different boolean columns that represent whether or not that row fulfills a series of conditions. Now I want to use a slicer to select which column I want to filter the table through. Is there any way to do that?

 

Thanks in advance for your help! 

10 Replies

  • nvprasad's avatar
    nvprasad
    Icon for Solution Sage rankSolution Sage

    Hi,

     

    In the power query editor do the unpivot transformation to get all 7 columns into the one column and their responses in the next column.

    This way you can slice based on 7 columns.

    Appreciate a Kudos! 🙂
    If this helps and resolves the issue, please mark it as a Solution! 🙂

    Regards,
    N V Durga Prasad

    • msl088's avatar
      msl088
      Frequent Visitor

      Here's an example of what I want to do. I have this data table.

      GKEYWEIGHTSIZE1234567
      1234400040FALSEFALSEFALSEFALSEFALSETRUETRUE
      6541350045FALSETRUETRUETRUETRUETRUETRUE
      31201200020FALSEFALSEFALSEFALSEFALSEFALSEFALSE
      6584420022FALSEFALSETRUETRUETRUETRUETRUE
      2310630042FALSEFALSEFALSEFALSEFALSEFALSEFALSE
      5168400020FALSEFALSEFALSEFALSEFALSEFALSETRUE
      9841600040TRUETRUETRUETRUETRUETRUETRUE


      And I have a stacked bar chart that I need to change through a slicer like this.

       

      I think it's clearer now.

      • parry2k's avatar
        parry2k
        Icon for Super User rankSuper User

        msl088 as nvprasad recommended, unpivot your table. Follow these steps

         

        - transform data
        - select GKey, Weight, Size columns
        - right-click, unpivot other columns it will add two columns, attribute, and value, rename these as per your requirement
        - close and apply

         

        Now you can use attribute as a slicer, or what you renamed it to,

        I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.