Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Xilitor01
Helper III
Helper III

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 2
Surya9
Helper V
Helper V

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. 

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

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.