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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there,
I have a measure with a condition that returns me 1 for TRUE and 0 for FALSE.
What do I do, to sum up, all the 1 (True) results?
The condition works with this logic: if the amount of alerts is greater or equal to the number of devices, so it will count as 1.
then, my right outcome in the below example would be 2 as a result of the "Measure"
Solved! Go to Solution.
Hi @nelson777
You may try
Measure1 =
SUMX (
VALUES ( d_time[Hour Num] ),
CALCULATE (
VAR Client =
MAX ( d_clients[Client Full Name] )
VAR devices_per_client =
CALCULATE (
DISTINCTCOUNT ( d_devices[Device] ),
d_clients[Client Full Name] = Client
)
VAR Alerts =
CALCULATE ( [Alerts], VALUES ( f_alerts[Start Date] ) )
VAR Tag =
IF ( Alerts >= devices_per_client, 1, 0 )
RETURN
Tag
)
)
Hi @nelson777
You may try
Measure1 =
SUMX (
VALUES ( d_time[Hour Num] ),
CALCULATE (
VAR Client =
MAX ( d_clients[Client Full Name] )
VAR devices_per_client =
CALCULATE (
DISTINCTCOUNT ( d_devices[Device] ),
d_clients[Client Full Name] = Client
)
VAR Alerts =
CALCULATE ( [Alerts], VALUES ( f_alerts[Start Date] ) )
VAR Tag =
IF ( Alerts >= devices_per_client, 1, 0 )
RETURN
Tag
)
)
Hey, @tamerj1 thank you very much!
I got to resolve that before you reply to me but in a different way. However, your solution is way cleaner than mine. lol
Would you mind helping me to figure now how to get the duration sum by obeying the same rules as before?
I worked it out. Thanks very much!!!!!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 10 |