Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
what function shall i use for a measure that dcounts names column "Name" which have only one/single occurance in column "Product".
what I have:
I want my measure to show:
Dcount of names that have only apples (BBB and DDD) = 2.
I can solve this with 2 steps but this way seems a bit coplicated.
1. adding an extra column "C" that shows how many distinct products each Name has;
2. and then creating a measure e.g. calculate(distinctcount(NAME), C = 1, Product = "apple". C = 1 means that eg DDD has only 1 product.
thank you in advance
Solved! Go to Solution.
Hi, @Kudy
In fact, your original solution is sufficiently general and straightforward. The code I provide below is just to give you a different idea.
Measure1 =
VAR tab1 =
SUMMARIZE (
'Table',
'Table'[Name],
"first_product", MIN ( 'Table'[Product] ),
"last_product", MAX ( 'Table'[Product] )
)
RETURN
COUNTROWS (
FILTER ( tab1, [first_product] = "apple" && [last_product] = "apple" )
)
Best Regards,
Community Support Team _ Eason
HI @Kudy
Try this:
Measure = calculate(distinctcount(table[name]),filter(all(table),table[product]="apple"))
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi Vahid,
and thank you for your answer!
I tried your solution but unfortunately did not get the result I needed. It gave me = 3 instead of 2
Hi, @Kudy
In fact, your original solution is sufficiently general and straightforward. The code I provide below is just to give you a different idea.
Measure1 =
VAR tab1 =
SUMMARIZE (
'Table',
'Table'[Name],
"first_product", MIN ( 'Table'[Product] ),
"last_product", MAX ( 'Table'[Product] )
)
RETURN
COUNTROWS (
FILTER ( tab1, [first_product] = "apple" && [last_product] = "apple" )
)
Best Regards,
Community Support Team _ Eason
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 13 | |
| 10 | |
| 10 |