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! It's time to submit your entry. Live now!
I have a column called ID and another called Status.
I want to create a new column called NEW COL.
If Status = "Yes" for any of the rows with the same ID then the NEW COL = "Yes" for those rows, else
If Status = "Partial" for any of the rows with the same ID then the NEW COL = "Partial" for those rows, else
If Status = "No" for any of the rows with the same ID then the NEW COL = "No" for those rows.
| ID | Status | NEW COL |
| 1 | Yes | Yes |
| 1 | No | Yes |
| 1 | No | Yes |
| 2 | Partial | Yes |
| 2 | Yes | Yes |
| 2 | No | Yes |
| 3 | No | Partial |
| 3 | Partial | Partial |
| 3 | No | Partial |
| 3 | No | Partial |
| 4 | No | No |
| 4 | No | |
| 4 | No | No |
| 4 | No | No |
So essentially, a "Yes" overides "Partial" and "No"; "Partial" overides "No"; everything else is "No".
Solved! Go to Solution.
Give this a try.
New Status =
VAR _Yes = CALCULATE(COUNTROWS(VALUES('Table'[ID])),'Table'[Status]="Yes",ALLEXCEPT('Table','Table'[ID]))
VAR _Partial = CALCULATE(COUNTROWS(VALUES('Table'[ID])),'Table'[Status]="Partial",ALLEXCEPT('Table','Table'[ID]))
RETURN
SWITCH(
TRUE(),
_Yes > 0, "Yes",
_Partial > 0, "Partial",
"No"
)
That is how you would do it as a calculated column. You would just put that DAX in as the new column on the table.
Give this a try.
New Status =
VAR _Yes = CALCULATE(COUNTROWS(VALUES('Table'[ID])),'Table'[Status]="Yes",ALLEXCEPT('Table','Table'[ID]))
VAR _Partial = CALCULATE(COUNTROWS(VALUES('Table'[ID])),'Table'[Status]="Partial",ALLEXCEPT('Table','Table'[ID]))
RETURN
SWITCH(
TRUE(),
_Yes > 0, "Yes",
_Partial > 0, "Partial",
"No"
)
Hey @jdbuchanan71 , thanks again for your solution.
As an add-on to the above, how could I have this column (or measure) respond to a slicer.
I posted this question here:
Add column whose value depends on two other column... - Microsoft Power BI Community
Thanks mate. Is there a way to do this as a calculated column too, as I wanted to chuck the result in a pie chart?
Hi,
This calculated column formula works
=if(CALCULATE(COUNTROWS(Data),FILTER(data,Data[ID]=EARLIER(Data[ID])&&Data[Status]="Yes"))>0,"Yes",if(CALCULATE(COUNTROWS(Data),FILTER(data,Data[ID]=EARLIER(Data[ID])&&Data[Status]="Partial"))>0,"Partial","No"))
Hope this helps.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 42 | |
| 41 | |
| 21 | |
| 21 |
| User | Count |
|---|---|
| 150 | |
| 106 | |
| 65 | |
| 36 | |
| 36 |