Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |