Forum Discussion

eldarkt's avatar
eldarkt
Icon for Microsoft Employee rankMicrosoft Employee
9 years ago
Solved

Filter by multiple sets of column

Hi all, I have a data set like this:

 

Customer1_value1Customer1_value2…Customer1_value15Customer2_value1…Customer2_value15…CustomerN_value1…CustomerN_value15
0.2291516520.155057721…0.3245843120.110479662…0.090275502…0.967682291…0.48551334
0.5472410.767585491…0.9060742920.443983587…0.395398869…0.59960649…0.221637108
0.8956288990.814316364…0.9496358270.101984896…0.922149649…0.059627022…0.065165743
……………………………

 

So this is N sets of 15 columns. 
Technically, N<20, but the main problem for me it's dynamic, N will change from time to time.
One set for every N value always contains 15 columns, this value is static.
All data types for different N values is the same (for example, Customer1_value2 and Customer2_value2 and CustomerN_value2 columns has the same data type)

What I wnat to achieve is to be able to filter all my visual by N (for example, with "slicer" visual).
Any help would be appreciated.

  • Hi eldarkt,

     

    This approach should do the trick

    1. select the column 'Attribute.2'

    2. Select 'Pivot Column' on the Transform tab

    3. In the pop-up select 'Value' as Values Column

6 Replies

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

    eldarkt

     

    i am just trying to understand what you are asking for.

     

    You want to take the below 15 columns and be able to filter all of them at the same time? so combining all of this into one column via a pivot wouldn't work for you or would? 

    • eldarkt's avatar
      eldarkt
      Icon for Microsoft Employee rankMicrosoft Employee

      What I want to achieve is convert from this structure:

      DatetimeCustomer1_value1Customer1_value2…Customer1_value15Customer2_value1Customer2_value2…Customer2_value15…CustomerN_value1CustomerN_value2…CustomerN_value15
      datetime10.2291516520.155057721…0.3245843120.1104796620.16026891…0.090275502…0.9676822910.493830084…0.48551334
      datetime20.5472410.767585491…0.9060742920.4439835870.223704644…0.395398869…0.599606490.86645009…0.221637108
      datetime30.8956288990.814316364…0.9496358270.1019848960.977557759…0.922149649…0.0596270220.234168244…0.065165743
      ……………………………………

       

       

      to this:


      Datetimevalue1value2…value15Customer
      datetime10.2291516520.155057721…0.324584312Customer1
      datetime10.1104796620.16026891…0.090275502Customer2
      ………………
      datetime10.9676822910.493830084…0.48551334CustomerN
      datetime20.5472410.767585491…0.906074292Customer1
      datetime20.4439835870.223704644…0.395398869Customer2
      ………………
      datetime20.599606490.86645009…0.221637108CustomerN
      datetime30.8956288990.814316364…0.949635827Customer1
      datetime30.1019848960.977557759…0.922149649Customer2
      ………………
      datetime30.0596270220.234168244…0.065165743CustomerN
      ………………

       

      Sorry, I am trying to not overcomplicate things...
      Thanks!

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

        I guess you could try something like this:

        1. Open the Query Editor

        2. Select the Query that loads your table

        3. Select all the columns besides your values columns

        4. On the Transform tab open the drop down menu on 'Unpivot Colomns' and select 'Unpivot other columns'

        5. Select your column with the values Customer1_value1, Customer1_Value2...CustomerN_ValueN and use the Split Column By delimiter (on the Home tab) to split the column into 2 column. Use '_' to split the column

        6. Detele the column with the values Value1, Value2...ValueN (if you don't need it)

        7. Rename columns to what ever you want.