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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rjesak
Helper I
Helper I

Create a string from columns and use a slicer to search IN the string

I'm trying to figure out the best way to organize this.

 

I have a table describing items - the items can come in a few different colors. 

 

seqitemcolor
111bikeblue
111bikegreen
112boatblue
113trainblue
113trainwhite
113traingreen
114tricyclepurple

 

I have two requirements:

1. I want to be able to display all the colors for that item in a single column in a visual separated by a comma:

 

111bikeblue, green
112boatblue
113trainblue, green, white
114tricyclepurple

 

2. I want to build a slicer that shows the colors and will select any of the rows that include that color. So the slicer options would be

blue

green

white

purple

 

If the user selected blue, the visual would show:

111bikeblue, green
112boatblue
113trainblue, green, white

 

if they selected white, they would see:

111bikeblue, green
112boatblue
113trainblue, green, white

 

 

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi @Rjesak ,

create a new calculated column like this:

 

06-05-_2021_00-36-57.png

 

Use a table visual and a slicer as shown in figure:

 

06-05-_2021_00-38-54.png

 

Sample PBIX-file is attached.

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

3 REPLIES 3
Rjesak
Helper I
Helper I

You are both SO awesome and both the solutions work so I just marked the first one as the solution. But thank you both so much!

FrankAT
Community Champion
Community Champion

Hi @Rjesak ,

create a new calculated column like this:

 

06-05-_2021_00-36-57.png

 

Use a table visual and a slicer as shown in figure:

 

06-05-_2021_00-38-54.png

 

Sample PBIX-file is attached.

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

CNENFRNL
Community Champion
Community Champion

 

Colours = CONCATENATEX( info, Info[color], ", " )
Colors = CALCULATE( [Colours], VALUES( Info[item] ), ALL( Info[color] ) )

 

Screenshot 2021-05-06 001420.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.