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
Sean
Community Champion
Community Champion

How to split column and show all unique values in a slicer

I have a column showing Street/Highway Names but sometimes if a location is at an intersection it shows 2 Street names

always separated by &

 

For example:

COLUMN

Street 1

Street 1 & Street 2

Street 1 & Street 3

Street 4

Street 5 & Street 6

Street 7

 

How can I create a single column to be used for a slicer that lists ALL unique Street names only.

 

SLICER

Street 1 => should pull up the intersections as well so 3 total locations

Street 2

Street 3

Street 4

Street 5

Street 6

Street 7

etc...

 

Thanks!

 

1 ACCEPTED SOLUTION
austinsense
Impactful Individual
Impactful Individual

You're gonna have to use the query editor in Power BI to create a new table.  Here are the steps ...

 

** Start with the table that has the street names on it **

1) remove all columns except the unique row identifier and the street name column,

2) split your street name column on the "&", trim the results of all the columns

3) unpivot all the columns EXCEPT the unique row identifier into one column (so now you only have two columns - unique row identifier and street name),

4) select both columns and remove duplicate values - although you shouldn't have any duplicates

 

You can then take this table in the data model and then join it to the original table using the unique row identifier.  Make sure you set the relationship between the tables to be bi-directional.  Your new table is used for your slicer.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

View solution in original post

2 REPLIES 2
austinsense
Impactful Individual
Impactful Individual

You're gonna have to use the query editor in Power BI to create a new table.  Here are the steps ...

 

** Start with the table that has the street names on it **

1) remove all columns except the unique row identifier and the street name column,

2) split your street name column on the "&", trim the results of all the columns

3) unpivot all the columns EXCEPT the unique row identifier into one column (so now you only have two columns - unique row identifier and street name),

4) select both columns and remove duplicate values - although you shouldn't have any duplicates

 

You can then take this table in the data model and then join it to the original table using the unique row identifier.  Make sure you set the relationship between the tables to be bi-directional.  Your new table is used for your slicer.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂
Sean
Community Champion
Community Champion

Thanks! Works great.

 

 

 

 

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.