cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
brandonavants Frequent Visitor
Frequent Visitor

Need Help with Dax formula

I'm new to the DAX formula world and I cannot figure out a logic statement I was hoping someone could assist.  

 

So, in english I want to evaluate a field called [Department] to see if it is blank and if it is I then want to look at the [Created By] email address.  The final part is if [Created By] = brandon@brandon.com I want [DepartmentRevised] to read Department A, bob@brandon.com to read Department B, and all the other departments that weren't blank to read their true department.  Thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
malagari Member
Member

Re: Need Help with Dax formula

Are you trying to make a new column that is conditional, based on columns within the same table?  If so, you should be able to do something like this:

 

 

NewColumn = IF( ISBLANK( [Department] ), 
[Created By], SWITCH( [Created By],
"brandon@brandon.com", "Department A",
"bob@brandon.com", "Department B",
[Department]
)
)

 

This is essentially saying "If Department is blank, show the CreatedBy email address.  Otherwise, look at the CreatedBy email address.  If it's brandon, return Department A.  If it's bob, return Department B.  If it's not equal to brandon or bob, return the original Department."

 

Dan Malagari
Consultant at Headspring

View solution in original post

1 REPLY 1
malagari Member
Member

Re: Need Help with Dax formula

Are you trying to make a new column that is conditional, based on columns within the same table?  If so, you should be able to do something like this:

 

 

NewColumn = IF( ISBLANK( [Department] ), 
[Created By], SWITCH( [Created By],
"brandon@brandon.com", "Department A",
"bob@brandon.com", "Department B",
[Department]
)
)

 

This is essentially saying "If Department is blank, show the CreatedBy email address.  Otherwise, look at the CreatedBy email address.  If it's brandon, return Department A.  If it's bob, return Department B.  If it's not equal to brandon or bob, return the original Department."

 

Dan Malagari
Consultant at Headspring

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 241 members 2,301 guests
Please welcome our newest community members: