Forum Discussion
Adam1V
6 years agoFrequent Visitor
Custom Column - Multiple If Statement
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 form...
- 6 years ago
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 "" - Anonymous6 years ago
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 ""