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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I'm trying to perform a distinctcount based on a field that has two set of factors:
1. First distinctcount is when the field only matches value "X". If it does, I'd like to multiply this distinctcount by (1-r) where r is a %.
2. Second distinctcount is when the field matches all other values but not "X". If it does, I'd like to just return the distinctcount for those but not include the distinctcount from "X".
Am I able to do this with one measure?
Hi @kenshaw your measures could be something like below, adjust part 'YourTable'[ColumnX] to your names
FirstDistinctCountWeighted =
VAR CountX =
CALCULATE(DISTINCTCOUNT('YourTable'[ColumnX]), 'YourTable'[ColumnX] = "X")
RETURN
IF (CountX > 0, CountX * (1 - (YOUR_WEIGHT_PERCENTAGE / 100)), 0)
SecondDistinctCount =
VAR CountAllButX =
CALCULATE(DISTINCTCOUNT('YourTable'[ColumnX]), NOT('YourTable'[ColumnX] = "X"))
RETURN
IF (CountAllButX > 0, CountAllButX, 0)
Proud to be a Super User!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
12 | |
10 | |
9 | |
9 |