Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I have written this formula as a part of custom column:
if[GRP]="3" then "Contract" else if[GRP]="4" then Contract" else if[GRP]="6" then "Contract" else if[GRP]="7" then "Contract" else if[GRP]="9" then "Contract" else if[GRP]="2" then "Contract" else if([GRP]="B" and [JOB] <> 12345) then "Contract" else "Regular Employee"
I executed the same for another table and it worked but whenn I create the same for another table and check for else if([GRP]="ZY" and [JOB] <> 12345) then "Contract" with filters it does not show regular for the job = 12345.
Any idea as to why this could happen? Because, it gets executed perfectly in another table. Basically if GRP=B and JOB is not equal to 12345 then it is under contract else, regular. But when I filter for GRP=B and JOB=12345 it still comes under contract for me.
Solved! Go to Solution.
Hey, I tried the same code again with the text instead of code and it worked
HI @Anonymous,
According to your description, I think your formula is m query instead of dax formula.
You can try to use below formula if it sutiable for your scenario.
M query formula:
#"Added Custom" = Table.AddColumn(#"Preview step", "Custom column", each if List.Contains({"2","3","4","6","7","9"},[GRP]) or ([GRP]="B" and [JOB] <> 12345) then "Contract" else "Regular Employee")
Dax formule:
Dax formula=
IF (
OR (
[GRP] IN { "3", "4", "6", "7", "9", "2" },
AND ( [GRP] = "B", [JOB] <> 12345 )
),
"Contract",
"Regular Employee"
)
Regards,
Xiaoxin Sheng
Hey, I tried the same code again with the text instead of code and it worked
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |