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.
Hi,
Im extremly new to Power Bi so hoping this isnt a silly question.
Im looking to expand on employees initials within power bi and im trying to use a custom column to do so with the below formula, however im getting an 'Expression Error - The Name 'If' wasnt recogised". Can anyone advise where I may be going wrong?
IF([DESIGN ENGINEER]="PG","PAUL Gxxxx",IF([DESIGN ENGINEER]="AB","ASHLEY Bxxxx",IF([DESIGN ENGINEER]="SG","SAM Gxxxx",IF([DESIGN ENGINEER]="TB","TOM Bxxxx",IF([DESIGN ENGINEER]="NBJ","NATHAN Bxxxx",IF([DESIGN ENGINEER]="LB","LLOYD Bxxxx",IF([DESIGN ENGINEER]="DW","DAVE Wxxxx",IF([DESIGN ENGINEER]="AMV","ADAM Vxxxx",IF([DESIGN ENGINEER]="DB","DAVID Bxxxx","")))))))))
Solved! Go to Solution.
Actually just managed to resolve this, below for anyone else searching for this in the future;
if [DESIGN ENGINEER] = "PG" then "PAUL Gxxxxx" else if [DESIGN ENGINEER] = "AB" then "ASHLEY Bxxxxx" else if [DESIGN ENGINEER] = "SG" then "SAM Gxxxxx" else if [DESIGN ENGINEER] = "TB" then "TOM Bxxxx" else if [DESIGN ENGINEER] = "NBJ" then "NATHAN Bxxxx" else if [DESIGN ENGINEER] = "LB" then "LLOYD Bxxxx" else if [DESIGN ENGINEER] = "DW" then "DAVE Wxxxx" else if [DESIGN ENGINEER] = "AMV" then "ADAM Vxxxx" else if [DESIGN ENGINEER] = "DB" then "DAVID Bxxxx" else ""
Is this in the query editor? It looks like DAX syntax but that error sounds like the query editor, which uses a different language. If statements there have a completely different syntax. In the query editor an if statement looks like this (case sensitive)
if [DESIGN ENGINEER]="PG" then "PAUL Gxxxx"
else if [DESIGN ENGINEER]="AB" then "ASHLEY Bxxxx"
else if [DESIGN ENGINEER]="SG" then "SAM Gxxxx"
...
else ""
Proud to be a Super User!
Is this in the query editor? It looks like DAX syntax but that error sounds like the query editor, which uses a different language. If statements there have a completely different syntax. In the query editor an if statement looks like this (case sensitive)
if [DESIGN ENGINEER]="PG" then "PAUL Gxxxx"
else if [DESIGN ENGINEER]="AB" then "ASHLEY Bxxxx"
else if [DESIGN ENGINEER]="SG" then "SAM Gxxxx"
...
else ""
Proud to be a Super User!
@Adam1V i am guessing that you are doing it in M. The correct syntax would be
if [DESIGN ENGINEER]="PG" then "A" else if [DESIGN ENGINEER]="AB" then "B" else if[DESIGN ENGINEER]="SG" then "C" else -800
Actually just managed to resolve this, below for anyone else searching for this in the future;
if [DESIGN ENGINEER] = "PG" then "PAUL Gxxxxx" else if [DESIGN ENGINEER] = "AB" then "ASHLEY Bxxxxx" else if [DESIGN ENGINEER] = "SG" then "SAM Gxxxxx" else if [DESIGN ENGINEER] = "TB" then "TOM Bxxxx" else if [DESIGN ENGINEER] = "NBJ" then "NATHAN Bxxxx" else if [DESIGN ENGINEER] = "LB" then "LLOYD Bxxxx" else if [DESIGN ENGINEER] = "DW" then "DAVE Wxxxx" else if [DESIGN ENGINEER] = "AMV" then "ADAM Vxxxx" else if [DESIGN ENGINEER] = "DB" then "DAVID Bxxxx" else ""
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 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |