Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Slicers using Grouped Data

Hello!   I have a dataset based on Commodities that I would like to be able to display data based on the selected group of commodities.   For example - I've grouped the below items according to t...
  • DataInsights's avatar
    4 years ago

    Anonymous,

     

    Try this calculated column:

     

    Group = 
    VAR vItem = Table1[Item]
    VAR vResult =
        SWITCH (
            TRUE (),
            vItem IN { "cheese", "milk", "butter", "oil" }, "Dairy",
            vItem IN { "sugar", "aluminum" }, "Soda"
        )
    RETURN
        vResult

     

     

    Create a slicer using the Group column.