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
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
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.

Top Solution Authors