Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Accessing Data using Slicers

hi there, I have a table of customer shopping list, there is a column called Category where for instance a customer bought 2 items of different category ( example : clothing and food & beverages). Therefore in the selected customer's row, the quantity is 2 and category is clothing, food & beverages. When accessing the category column using slicers, when i select clothing, the specific row does not show up. it only display the category that has one clothing only instead of displaying all the categories that includes clothing in it. how do i make this work?

cust_idquantitycategory
0011clothing
0021food & beverages
0032clothing, food & beverages

from example table above, when i select 'clothing' category using slicers, it only display the info for cust_id 001 instead of display both cust_id 001 and cust_id 003. how do i fix this?

  • Anonymous , To resolve this split the category in Power Query

    plit the Column by Delimiter:

    Select the "category" column.
    Go to the "Transform" tab, click on "Split Column," and choose "By Delimiter."
    Choose the delimiter (in your case, it seems to be a comma followed by a space ", ").
    Unpivot the Columns:

    After splitting, you will have multiple columns for categories.
    Select the columns that were created from the split.
    Go to the "Transform" tab and click on "Unpivot Columns."
    Rename Columns:

    Rename the resulting columns to something meaningful, like "category" and "value."

     

2 Replies

  • Anonymous , To resolve this split the category in Power Query

    plit the Column by Delimiter:

    Select the "category" column.
    Go to the "Transform" tab, click on "Split Column," and choose "By Delimiter."
    Choose the delimiter (in your case, it seems to be a comma followed by a space ", ").
    Unpivot the Columns:

    After splitting, you will have multiple columns for categories.
    Select the columns that were created from the split.
    Go to the "Transform" tab and click on "Unpivot Columns."
    Rename Columns:

    Rename the resulting columns to something meaningful, like "category" and "value."

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      thank you so much!