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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ericOnline
Post Patron
Post Patron

Create slicer of distinct values in a single column

I'm not sure why this is so non-intuitive...

Sample Data:

FnameLnameJobTitle
BobSmithCarpenter
SallyJonesCarpenter
YvonneBrinkleyBlacksmith

Goal:

- Create a DAX Measure that defines unique JobTitles

- Add a slicer of unique Job Titles to dashboard

image.png

Tried so far:

- This should be as easy as creating the following measure...

 

UNIQUE_JOBTITLES = DISTINCT('SAMPLE_DATA'[JobTitle])

 

- ...or slightly less intuitively...

 

UNIQUE_JOBTITLES = VALUES('SAMPLE_DATA'[JobTitle])

 

 - ...then applying the measure to the Slicer visual.

Which mystic formulae am I missing here?

Thank you

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @ericOnline 

I think the first thing you should keep in mind is that the goal of creating a measure is to calculate the value based on the DAX formula. And measure can't be placed in Slicer. So I think maybe creating measures is not a good solution. To get the distinct value of the column [JobTitle], I think creating a calculated table is the best way to achieve this, you can try my steps:

  1. Create a calculated table:
Table 2 =

SUMMARIZE('Table','Table'[JobTitle])

v-robertq-msft_0-1608623286301.png

 

  1. Create a relationship between the two tables:

屏幕截图 2020-12-22 155009.png

  1. Create a Slicer and place ‘Table 2’[JobTitle], you can get what you want, like this:

v-robertq-msft_2-1608623286315.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @ericOnline 

I think the first thing you should keep in mind is that the goal of creating a measure is to calculate the value based on the DAX formula. And measure can't be placed in Slicer. So I think maybe creating measures is not a good solution. To get the distinct value of the column [JobTitle], I think creating a calculated table is the best way to achieve this, you can try my steps:

  1. Create a calculated table:
Table 2 =

SUMMARIZE('Table','Table'[JobTitle])

v-robertq-msft_0-1608623286301.png

 

  1. Create a relationship between the two tables:

屏幕截图 2020-12-22 155009.png

  1. Create a Slicer and place ‘Table 2’[JobTitle], you can get what you want, like this:

v-robertq-msft_2-1608623286315.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AllisonKennedy
Super User
Super User

@ericOnline  You can't use a measure to create a slicer - only columns can be used for slicers, axis, legend, etc. As @Fowmy mentioned, you don't need to create any formula for this to work. If you do need a table of distinct values, create a new TABLE not a new MEASURE. Power BI Order of Operations 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Fowmy
Super User
Super User

@ericOnline 

You do not need a formula, drag and drop the Job Title Column to a slicer, it will show you the distinct values.

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

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.