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, I have a table of the form:
id case status 0 1 xx 0 555 yy 0 125 zz 2 87 yy 2 nn xx
And I am trying to code something like the below:
for every id if 1 case has status xx and 1 case has status yy, THEN I want yy = xx
So the resulting table would be
id case status 0 1 xx 0 555 **xx** 0 125 zz 2 87 **xx** 2 nn xx
I tried with
Column=
IF (
MAXX (
FILTER (
'Table',
'Table'[id] = EARLIER ( 'Table'[id] )
&& 'Table'[status] = "xx"
),
'Table'[status]
) = "",
"",
"xx"
)but that doesn't work as it would transform all the *statuses* per *id* into -xx-.
Any help on this?
Thanks
Solved! Go to Solution.
You can create a calculated column like
Actual Status = IF( 'Table'[status] = "yy",
VAR NumXX = CALCULATE(
COUNTROWS( 'Table' ),
ALLEXCEPT( 'Table', 'Table'[id]),
'Table'[status] = "xx"
)
VAR NumYY = CALCULATE(
COUNTROWS( 'Table' ),
ALLEXCEPT( 'Table', 'Table'[id] ),
'Table'[status] = "yy"
)
VAR Result = IF( NumXX = 1 && NumYY = 1, "xx", 'Table'[status] )
RETURN Result,
'Table'[status]
)
You can create a calculated column like
Actual Status = IF( 'Table'[status] = "yy",
VAR NumXX = CALCULATE(
COUNTROWS( 'Table' ),
ALLEXCEPT( 'Table', 'Table'[id]),
'Table'[status] = "xx"
)
VAR NumYY = CALCULATE(
COUNTROWS( 'Table' ),
ALLEXCEPT( 'Table', 'Table'[id] ),
'Table'[status] = "yy"
)
VAR Result = IF( NumXX = 1 && NumYY = 1, "xx", 'Table'[status] )
RETURN Result,
'Table'[status]
)
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 |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 31 | |
| 19 | |
| 13 | |
| 10 |