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
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!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |