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
Hello everyone, I am still new to DAX and I have a situation here that I've been looking to solve for a few days.
I have a table below and I am trying to populate Account_Status. The logic is bascially if the Unique_ID is same (group) and if any field in Product_Subscription is = 'Active' for this group, then Account_Status should be Active. How do I get this kind of output?
Thank you in advance!
| Unique_ID | Product | Product_Subscription | Account_Status |
| 100 | P1 | Active | Active |
| 100 | P1 | Inactive | Active |
| 100 | P2 | Inactive | Active |
| 100 | P3 | Active | Active |
| 200 | P1 | Inactive | Active |
| 200 | P2 | Active | Active |
| 200 | P3 | Inactive | Active |
| 200 | P3 | Active | Active |
| 200 | P3 | Active | Active |
| 300 | P2 | Inactive | Inactive |
| 300 | P2 | Inactive | Inactive |
Solved! Go to Solution.
Hi @Anonymous ,
Please try like this:
Account_Status =
VAR CountActive =
CALCULATE (
COUNTROWS( 'Table' ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Unique_ID] ),
'Table'[Product_Subscription] = "Active"
)
)
RETURN
IF ( CountActive > 0, "Active", "Inactive" )
Hi @Anonymous ,
Please try like this:
Account_Status =
VAR CountActive =
CALCULATE (
COUNTROWS( 'Table' ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Unique_ID] ),
'Table'[Product_Subscription] = "Active"
)
)
RETURN
IF ( CountActive > 0, "Active", "Inactive" )
Thank you very much! This worked 🙂
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 46 | |
| 42 | |
| 34 | |
| 31 | |
| 21 |
| User | Count |
|---|---|
| 143 | |
| 125 | |
| 100 | |
| 81 | |
| 63 |