Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
99 | |
73 | |
72 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |