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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Convert DAX measure to create new custom column

I have a table with a column called Author which contains both employee names and manager names. I created a measure that checks another column called Employee Name to see if the names are within the Author column to produce a value of either "Employee" or "Manager" (Is the Author an Employee or a Manager?). I was able to get the results I want from the measure but in order to use that information in my analysis I need to create a new column with these values. I need help converting my DAX measure to a new custom column.

 

Here is my measure:

Author is Employee = IF (
    CONTAINS (
        VALUES ( 'GetDevelopmentGoalDetail'[Column1.Author] ),
        'GetDevelopmentGoalDetail'[Column1.Author], SELECTEDVALUE ( GetDevelopmentGoalDetail[Employee Name] )
    ),
    "Employee",
    "Manager"
)
 
Here are the results that I was able to create from my measure but need those values in a new custom column. 
Screen Shot 2023-03-11 at 3.54.18 PM.png
 
This is dummy data so no sensitive information is shared.

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Seems they are both in the same table. You can simply do

Author is Employee =
IF (
    'GetDevelopmentGoalDetail'[Column1.Author] = 'GetDevelopmentGoalDetail'[Employee Name],
    "Employee",
    "Manager"
)

or even

Author is Employee =
IF (
    'GetDevelopmentGoalDetail'[Employee Name] = BLANK ( ),
    "Manager",
    "Employee"
)

View solution in original post

11 REPLIES 11
tamerj1
Super User
Super User

Hi @Anonymous 
Seems they are both in the same table. You can simply do

Author is Employee =
IF (
    'GetDevelopmentGoalDetail'[Column1.Author] = 'GetDevelopmentGoalDetail'[Employee Name],
    "Employee",
    "Manager"
)

or even

Author is Employee =
IF (
    'GetDevelopmentGoalDetail'[Employee Name] = BLANK ( ),
    "Manager",
    "Employee"
)
Anonymous
Not applicable

Thank you, how could your first example be modified if it was [Employee Name] is in another table? If I simply change the table name in the current solution, an error of 'A table of multiple values was supplied where a single value was expected' is thrown. @tamerj1 

@Anonymous 

Is there a relationship between the two tables?

Anonymous
Not applicable

Yes, there is another table that has Employee Name. 

@Anonymous 

Yes, nut my question was: is the Employee table  related to the GetDevelopmentGoalDetail table? 

Anonymous
Not applicable

Yes, they both contain Employee Name.

@Anonymous 
Let me be more specific. Do you have or have you created an active relationship between the two tables?

Anonymous
Not applicable

Yes. Already established.

@Anonymous 

Thrn you can try

Author is Employee =
IF (
RELATED ( 'GetDevelopmentGoalDetail'[Employee Name] ) = BLANK (),
"Manager",
"Employee"
)

however, in this case I'm wondering why @FreemanZ didn't work 🤔

Anonymous
Not applicable

I will mark you solution above as correct, but was curious if the column was from another table. The data is called from an API and there are some repetative datasets. Was checking to confirm accuracy of my original results. Thank you.

FreemanZ
Super User
Super User

hi @Anonymous 

try like:

Column = 
IF (
     [Employee Name] IN VALUES ( data[Column1.Author] ),
    "Employee",
    "Manager"
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.