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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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