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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi all,
I am trying to get a distinct total for a card visualtions of ID's that have met either or one of the conditions. My issue is arrising as the conditions sit across different tables and i am unsure how to combine them together without double counting the ID's.
Example:
Table 1 | Table 2 | Table 3 | ||||
ID | ID | Type1 | ID | Type2 | ||
1 | 1 | 1 | 1 | a | ||
2 | 1 | 2 | 2 | a | ||
3 | 2 | 1 | 2 | a | ||
4 | 3 | 1 | 3 | b | ||
5 | 4 | 2 | 4 | b | ||
6 | 5 | 1 | 4 | a | ||
7 | 5 | 1 | 5 | b | ||
8 | 6 | 2 | 6 | a | ||
7 | 1 | 6 | b | |||
8 | 1 | 7 | a | |||
7 | a | |||||
7 | b | |||||
8 | a | |||||
8 | b | |||||
8 | b |
I am wanting to count the distint number of ID's that have had at least one Type 1 '1', and/or at least one Type2 'a'. The ID can have both Types, or just one Type to be counted, although the ID should not be counted twice if they have both.
Any help would be appreciated.
Thank you.
Solved! Go to Solution.
Hi @TBSST
Please try
ID Count =
COUNTROWS (
DISTINCT (
UNION (
CALCULATETABLE ( VALUES ( Table2[ID] ), Table2[Type1] = "1" ),
CALCULATETABLE ( VALUES ( Table3[ID] ), Table3[Type2] = "a" )
)
)
)
Hi @TBSST
Please try
ID Count =
COUNTROWS (
DISTINCT (
UNION (
CALCULATETABLE ( VALUES ( Table2[ID] ), Table2[Type1] = "1" ),
CALCULATETABLE ( VALUES ( Table3[ID] ), Table3[Type2] = "a" )
)
)
)