March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I have a column which has values of = "0", "1" and Empty.
How do I create a custom column which gives me the following information.
IF
0 = Fail
1 = Pass
Empty = Pass
I've been trying the below -
=IF [Attend Pass] = 1 then "Pass" else "Fail"
TIA
Solved! Go to Solution.
Hi @Anonymous ,
M code is completely case-sensitive, so using 'IF' instead of 'if' will cause the calculation to fail. Similarly, referencing '1' instead of ' "1" ' if the value is in a text field will also fail.
Also, your condition is picking out the 1 = pass criteria first. It's simpler to pick out the 0 = Fail first, then just apply pass to 1 and null as per your requirement.
Try these calculations to see what works for you:
// [Attend Pass] = numeric
if [Attend Pass] = 0 then "Fail" else "Pass"
// [Attend Pass] = text
if [Attend Pass] = "0" then "Fail" else "Pass"
Pete
Proud to be a Datanaut!
Hi @Anonymous ,
M code is completely case-sensitive, so using 'IF' instead of 'if' will cause the calculation to fail. Similarly, referencing '1' instead of ' "1" ' if the value is in a text field will also fail.
Also, your condition is picking out the 1 = pass criteria first. It's simpler to pick out the 0 = Fail first, then just apply pass to 1 and null as per your requirement.
Try these calculations to see what works for you:
// [Attend Pass] = numeric
if [Attend Pass] = 0 then "Fail" else "Pass"
// [Attend Pass] = text
if [Attend Pass] = "0" then "Fail" else "Pass"
Pete
Proud to be a Datanaut!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
12 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |