Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
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"
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 65 | |
| 41 | |
| 40 | |
| 39 | |
| 39 |