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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors