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 folks,
I am quite new to PowerBI and currently wokring on the following topic:
I do have messages and message_threads, both are in one table. Messages can be either OUTBOUND (sent by company) or INBOUND (sent by customer). I now want to count the number of active threads, meaning the number of threads where at least one message was sent by the customer.
| message-id | thread-id | message-type |
| 1 | 1 | OUTBOUND |
| 2 | 1 | OUTBOUND |
| 3 | 2 | OUTBOUND |
| 4 | 2 | INBOUND |
| 5 | 2 | OUTBOUND |
| 6 | 3 | OUTBOUND |
| 7 | 3 | OUTBOUND |
| 8 | 3 | INBOUND |
In this Case thread 2 and 3 are active threads (at least one message with type INBOUND). Thread 1 is not active.
The outcome I would expect would for example look like the following:
| message-id | thread-id | message-type | active |
| 1 | 1 | OUTBOUND | false |
| 2 | 1 | OUTBOUND | false |
| 3 | 2 | OUTBOUND | true |
| 4 | 2 | INBOUND | true |
| 5 | 2 | OUTBOUND | true |
| 6 | 3 | OUTBOUND | true |
| 7 | 3 | OUTBOUND | true |
| 8 | 3 | INBOUND | true |
Thanks a lot in advance 🙂
Solved! Go to Solution.
There's no need to use IF here since ISEMPTY is already a logical function. This is the same:
NOT ISEMPTY(
FILTER(
CALCULATETABLE(
T,
ALLEXCEPT(
T,
T[thread-id]
)
),
T[message-type] = "INBOUND"
)
)
// Let the table be T.
[# Active Threads] =
CALCULATE(
DISTINCTCOUNT( T[thread-id] ),
DISTINCT( T[thread-id] ),
T[message-type] = "inbound",
REMOVEFILTERS( T )
)
Hi @Anonymous
please try
=
IF (
ISEMPTY (
FILTER (
CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[thread-id] ) ),
TableName[message-type] = "INBOUND"
)
),
FALSE,
TRUE
)
There's no need to use IF here since ISEMPTY is already a logical function. This is the same:
NOT ISEMPTY(
FILTER(
CALCULATETABLE(
T,
ALLEXCEPT(
T,
T[thread-id]
)
),
T[message-type] = "INBOUND"
)
)
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 |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |