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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
A-Aron
Helper I
Helper I

Measure that counts distinct values in column with slicer

Hello - 

 

I have a table with 2 columns,  "warehouse" and "part number" below . I need to slicer filter by warehouse and see the distinct count of part numbers in that column filktered by the selected warehouse. when Slicer is on BR card value should read 2. When VV is selected it should read 1. Any help would be apreciated. 

Warehouse Part number 
BR300
BR250
VV250
VV250
VV250
VV250
VV250

 

1 ACCEPTED SOLUTION

hi @A-Aron 

then how about:

measure = 
CALCULATE(
    DISTINCTCOUNT(TableName[part number]),
   ALL(TableName),
   VALUES(TableName[warehouse])
)

View solution in original post

6 REPLIES 6
FreemanZ
Super User
Super User

hi @A-Aron 

 
try to
1) create a table visual with column Warehouse and Part number. 
2) Choose disctinct count for Part number.
3) Create a slicer with Warehouse column.
then you shall get what you need, or?
 

that method is generating an unexpected value. there are more distinct values than the standard count(distinct) choice is showing

Hello FreemanZ -

i have a slicer for filtering and a card as a visual, im looking for a measure that will allow distinct count of part number column and can be filtered by warehouse using slicer. is this possible?

hi @A-Aron 

yes. try to
1) create a slicer with warehouse column
2) feed a card visual with a measure like:
measure = DISTINCTCOUNT(TableName[part number])
 
then you get what you expect, or?

@FreemanZ 

i have tried this among other solutions but the value is not correct. the dataset has other columns causing the distinct count to be altered. i am hoping i can use a measure to look at only count of unique part numbers by warehouse. sorry if i cannot explain clearly. 

hi @A-Aron 

then how about:

measure = 
CALCULATE(
    DISTINCTCOUNT(TableName[part number]),
   ALL(TableName),
   VALUES(TableName[warehouse])
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.