Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Show output based on Selected Value

Hello,

 

I have the example data below:

ProductAttributesColor (Hidden)Size (Hidden)
Car1Blue,BigBlueBig
Car2Red,MediumRedMedium

The Attribute-column is made by Color & "," & Size - these are both hidden in the table but I have them as columns so I can add them as a slicer.

When no slicers/filters have been set it should show the Attributes with both color and size.

 

I have two slicers in the top: 1: Color and 2: Size

 

What I am aiming for:

Example 1:

If I filter Color = Blue in the 1st slicer it should only show the following:

ProductAttributes
Car1Blue

 

Example 2:

If I filter Size = Medium in the 2nd slicer it should only show the following:

ProductAttributes
Car2Medium

 

I have tried creating a calculated column like this, but it doesn't work:

Attribute =
IF(SELECTEDVALUE('table'[Color]) = "Blue", "Blue",
IF(SELECTEDVALUE('table'[Color]) = "Red", "Red",
IF(SELECTEDVALUE('table'[Size]) = "Big", "Big",
IF(SELECTEDVALUE('table'[Color]) = "Medium", "Medium",
'table'[Color] & "," & 'table'[Size]))
 
I hope someone can help 🙂

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    If you alredy have Color and size in table then the slicer should work as you are expecting there is no need to create measure for this. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      No because these two columns are hidden. Only the "Product" and "Attributes" are shown in the table. And I am not interested in the attribute to show both color and size when I am filtering - only when I am looking for an overview.

       

      Example: If I filter on Color = "Red" the Table would give:

      ProductAttributes
      Car1

      Red, Medium

       

      Whereas I am only interested in the attributed I am selecting so what I am looking for when I filter on Color ="Red":

      ProductAttributes
      Car1

      Red