Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi Everyone!
I'm struggling a long time with the following issue:
I have 2 groups of items that I calculated - > A and B.
I need to count all distinct values from Group B that do not exist in group A -> Group C.
The following query will demonstrate it:
Solved! Go to Solution.
@Anonymous
Please try now, I didn't test it,
New group Measure =
VAR A = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] = 0)
VAR B = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] >=1)
VAR C = COUNTROWS( DISTINCT ( EXCEPT ( A , B ) ) )
RETURN
C
Switch A and B within EXCEPT if you don't get the results.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
Not sure if you need a new table or measure,
For distinct count measure use the following:
New group Measure =
VAR A = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] = 0)
VAR B = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] >=1)
VAR C = DISTINCTCOUNT ( EXCEPT ( A , B ) )
For Table:
New group Table =
VAR A = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] = 0)
VAR B = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] >=1)
VAR C = EXCEPT ( A , B )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi Fowmy!
Thanks for your response.
I tried the measure you created but the last line of the query returns an error.
@Anonymous
If you need a measure, you need to use the first code block that I shared, for the table, you the 2nd one
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Yeh I know, what I'm tring to say that I get an error in the syntax of the measure.
It doesn't let me to use distinctcount - as showcased in the image I added in my previous answer.
@Anonymous
Please try now, I didn't test it,
New group Measure =
VAR A = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] = 0)
VAR B = CALCULATETABLE (VALUES(order[Material_Number]), order[Upsale_Amount] >=1)
VAR C = COUNTROWS( DISTINCT ( EXCEPT ( A , B ) ) )
RETURN
C
Switch A and B within EXCEPT if you don't get the results.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks a lot it works!!
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 |
---|---|
82 | |
42 | |
31 | |
27 | |
27 |