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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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