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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.