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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
Below is the dataset I have, it's a list of unique users and the AD groups they are in. I want to calculate how many people ONLY have Teams. That is if a user has both Teams and Exchange i don't wnat to include them. Then i want to calculate how many people ONLY have both Teams and Exchange.
I want to show that
Teams only users are 2 (Sam and David)
Teams and Exchange Only Users are 2 (Matt and John)
| Chad | Teams | |
| Chad | Office | |
| Chad | Exchange | |
| David | Teams | |
| Matt | Teams | |
| Matt | Exchange | |
| Sam | Teams | |
| John | Teams | |
| John | Exchange |
[# Users With Teams Only] =
var __result =
sumx(
values( T[Name] ),
calculate(
selectedvalue( T[ADGroup] ) = "Teams"
)
)
return
if( __result > 0, __result )
[# Users With Teams and Exchange] =
var __result =
sumx(
values( T[Name] ),
calculate(
var __groups = values( T[ADGroup] )
return
countrows( __groups ) = 2
&&
countrows(
intersect(
__groups,
{"Teams", "Exchange"}
)
) = 2
) * 1
)
return
if( __result > 0, __result )
Whether the above does what you need or not depends on what you really want... Check it out and if not, then tell me where it goes wrong. Thanks.
Best
D
Hey,
I am getting the following error. It doesn't like the SUMX function in it's current format?
MdxScript(Model) (8,3) calculation error in Measure "AD Groups'[Users with Teams Only]: The function SUMX cannot work with values of type Boolean.
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 |
|---|---|
| 9 | |
| 9 | |
| 6 | |
| 6 | |
| 6 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 14 |