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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi all,
I'm new to Power BI Desktop.
I want to create a flag in column in my data table that shows only "1" or "0" based on following condition:
If Fault = "1P_MH" or "2P_MH" and Status = "1", Then Flag = "1", otherwise "0"
| Fault | Status | Flag |
| 1P_MH | 0 | 0 |
| 1P_MH | 1 | 1 |
| 2P_MH | 0 | 0 |
| 2P_MH | 1 | 1 |
Any advices are welcome.
Thanks!
Best Regards
Solved! Go to Solution.
@linlook -
Flag Column =
SWITCH(TRUE(),
([Fault] = "1P_MH0" || [Fault] = "2P_MH0") && [Status] = 1,1,
0
)
@linlook -
Flag Column =
SWITCH(TRUE(),
([Fault] = "1P_MH0" || [Fault] = "2P_MH0") && [Status] = 1,1,
0
)
@linlook ,new column
In DAX
flag = if (([Fault] = "1P_MH" II [Fault] = "2P_MH") && [Status] = "1" , "1" , "0")
or
flag = if (([Fault] = "1P_MH" II [Fault] = "2P_MH") && [Status] = "1" , 1, 0)
in power query M
flag = if ([Fault] = "1P_MH" or [Fault] = "2P_MH") and [Status] = "1" then "1" else "0"
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 52 | |
| 39 | |
| 15 | |
| 15 |
| User | Count |
|---|---|
| 94 | |
| 81 | |
| 34 | |
| 29 | |
| 25 |