Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register 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
User | Count |
---|---|
9 | |
8 | |
5 | |
4 | |
3 |