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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
hi guys,
please i need you assistance, i have been trying to do this for a week now, i dont know if its my logic that is wrong. i have two measures as follows:
ActiveUsers =
VAR s= CALCULATE(DISTINCTCOUNT(allproducts[CustomerId]),allproducts[TradeType] = 1, allproducts[TradeStatus]=0)
return
IF(ISBLANK(s),0,s)
and
EquityUsers = CALCULATE(DISTINCTCOUNT(allproducts[CustomerId]),allproducts[AggregatePurchaseValue] > 0)
I would like to add these 2 measures and get the total number of distinct customers from the both of them.
this is a copy of my dataset
thank you
Solved! Go to Solution.
@Anonymous , Please try a measure like
ActiveUsers =
VAR s= CALCULATE(DISTINCTCOUNT(allproducts[CustomerId]),filter(allproducts ,(allproducts[TradeType] = 1 && allproducts[TradeStatus]=0) || allproducts[AggregatePurchaseValue] > 0))
return
IF(ISBLANK(s),0,s)
Hi @Anonymous
Do you want the intersect of the union of those two groups of customers?
Total users =
VAR activeUsers_ =
CALCULATETABLE (
DISTINCT ( allproducts[CustomerId] ),
allproducts[TradeType] = 1,
allproducts[TradeStatus] = 0
)
VAR equityUsers_ =
CALCULATETABLE (
DISTINCT ( allproducts[CustomerId] ),
allproducts[AggregatePurchaseValue] > 0
)
RETURN
COUNTROWS ( INTERSECT ( activeUsers_, equityUsers_ ) )
Use UNION instead of INTERSECT on the last line of code if that's what you need
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Thank you for your reply,
I tried both the union and the intersect, and they were not exactly what i wanted.
@amitchandak solution gave me the expected output.
@Anonymous , Please try a measure like
ActiveUsers =
VAR s= CALCULATE(DISTINCTCOUNT(allproducts[CustomerId]),filter(allproducts ,(allproducts[TradeType] = 1 && allproducts[TradeStatus]=0) || allproducts[AggregatePurchaseValue] > 0))
return
IF(ISBLANK(s),0,s)
Thank you.
This is exactly what i wanted.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 51 | |
| 41 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 130 | |
| 111 | |
| 48 | |
| 30 | |
| 28 |