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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mrhooki
Regular Visitor

SlicerTable not showing distinct values

In order to extract values imported from SharePoint list with multiple-value columns in Power BI (data shown as table) I have used “Field Values As Text” column, getting values in these “text” columns now displayed in single rows, delineated by semicolon. I then split the column by semicolon delimiter into to new columns with single values. Problem now is that the Slicer Table (Slicer Table = DISTINCT(UNION(VALUES(query[column 1); VALUES (query[column 2)))) I put in to display distinct values is not able to return distinct values for some reasons- it's in fact displaying all the distinct values in column 1 AND all the distinct values in column 2, which means I get duplicate values. Have checked excel table (source of lookup SharePoint list), SharePoint list export to excel, thinking some hidden characters might have been included when I split the column by semicolon (e.g. line space).  Help anyone?

 

 

1 ACCEPTED SOLUTION

@mrhooki 

You have some leading spaces on fields which makes them different to PowerBI.  

SlicerTable.jpg

You can use the TRIM and CLEAN functions in PowerQuery to get rid of that.  Then, to build the slicer table we can exclude empty rows (both "" and null) like so.

Slicer = 
DISTINCT(
UNION (
    CALCULATETABLE( DISTINCT ( ValuesAsText[Addperspnew1] ),ValuesAsText,ValuesAsText[Addperspnew1] <> BLANK()),
    CALCULATETABLE( DISTINCT ( ValuesAsText[Addperpnew2] ),ValuesAsText,ValuesAsText[Addperpnew2] <> BLANK())
)
)

View solution in original post

8 REPLIES 8
jdbuchanan71
Super User
Super User

@mrhooki 

I don't see anything wrong with your code but maybe try this instead (DISTINCT instead of VALUES).

Slicer Table =
DISTINCT (
    UNION ( DISTINCT ( query[column 1] ); DISTINCT ( query[column 2] ) )
)

@jdbuchanan71 thanks, but it doesn't do the trick I'm afraid. 

Can you share the two lists?

@jdbuchanan71 I don't know if this image makes any sense to you, but here you see the two columns in the middle and the slicer table supposed to extract the distinct values from these on the left:POWER BI issue.png

Sorry, I meant can you share a .pbix file that has the lists you are working with.  I am not able to figure out what the problem is without working on your actual data.

You can upload a file to OneDrive or DropBox and share the link here.

@mrhooki 

You have some leading spaces on fields which makes them different to PowerBI.  

SlicerTable.jpg

You can use the TRIM and CLEAN functions in PowerQuery to get rid of that.  Then, to build the slicer table we can exclude empty rows (both "" and null) like so.

Slicer = 
DISTINCT(
UNION (
    CALCULATETABLE( DISTINCT ( ValuesAsText[Addperspnew1] ),ValuesAsText,ValuesAsText[Addperspnew1] <> BLANK()),
    CALCULATETABLE( DISTINCT ( ValuesAsText[Addperpnew2] ),ValuesAsText,ValuesAsText[Addperpnew2] <> BLANK())
)
)

@jdbuchanan71 TRIM and CLEAN removes leading spaces and new CALCULATETABLE excludes blank rows. I now have an unique table, much appreciated!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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