Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
smoothbrain
New Member

Multiple IF followed by NOT (syntax error?)

Hey team, 

Recieved a lot of really useful information from this community already! Thank you! 

I'm essentially converting GUID's from Salesforce back to staff names for a visual: 

Staff = 
 IF('DataTable'[Staff GUID]="005Mn1234567", "Joe Bloggs",
 //the above converts the GUID to "Joe Bloggs"
 IF('DataTable'[Staff GUID]="005Mn1234568", "Jane Doe",
 //the above converts the GUID to "Jane Doe"

 
The issue I'm having - is currently I only know a portion of the GUID's, and I'm hoping for those I don't, in the calculated table it will just show the GUID. In my mind it went something like: 

NOT('DataTable'[Staff GUID]=("005Mn1234567", 005Mn1234568"), 'DataTable'[Staff GUID])

ie- if the GUID isn't specified as a staff name, just display the GUID. 

However getting all sorts of sytax errors and #error. 

Anyone have any direction or advice on this one? I'm extremely green with DAX. 

1 ACCEPTED SOLUTION
justinmartin
Microsoft Employee
Microsoft Employee

Hey Smoothbrain,

If you want to check if a value is in a list of values, you'd use the following syntax: 

'DataTable'[Staff GUID] IN { "005Mn1234567", 005Mn1234568" }

 

If you are creating a calculated column, the following pattern might be easier to maintain.

New Column = 
SWITCH (
    'DataTable'[Staff GUID],
    "005Mn1234567", "Joe Bloggs",
    "005Mn1234568", "Jane Doe",
    'DataTable'[Staff GUID]
)

View solution in original post

3 REPLIES 3
justinmartin
Microsoft Employee
Microsoft Employee

Hey Smoothbrain,

If you want to check if a value is in a list of values, you'd use the following syntax: 

'DataTable'[Staff GUID] IN { "005Mn1234567", 005Mn1234568" }

 

If you are creating a calculated column, the following pattern might be easier to maintain.

New Column = 
SWITCH (
    'DataTable'[Staff GUID],
    "005Mn1234567", "Joe Bloggs",
    "005Mn1234568", "Jane Doe",
    'DataTable'[Staff GUID]
)

@justinmartin that's done the trick! Thank you!

Hey @justinmartin 
Thanks for helping out! 

I have been creating a calculated colum, so I'll try this format! Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.