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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
unnijoy
Post Prodigy
Post Prodigy

Column name

Hi I have a Data base with Agent name and their Level. Now i need to get a dax which will look in each column and give me the name of the column in which the agent name is present.

NameLevelL1L2L3L4
MaxL3RexLuxMaxSam
SamL2MaxSamChrisHex

So i need to create this calulated column "Level" next to each Agent in Bi. We can see that max name is coming under L4 so i need L4 in Level column next to max. If the name is not present then i need blank. I need to achive this by Dax. 

How can we do this.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @unnijoy ,

 

Please try this:

Level = 
SWITCH(
    TRUE(),
    'Table'[L1]='Table'[Name],"L1",
    'Table'[L2]='Table'[Name],"L2",
    'Table'[L3]='Table'[Name],"L3",
    'Table'[L4]='Table'[Name],"L4"
)

vcgaomsft_0-1659408978287.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @unnijoy ,

 

Please try this:

Level = 
SWITCH(
    TRUE(),
    'Table'[L1]='Table'[Name],"L1",
    'Table'[L2]='Table'[Name],"L2",
    'Table'[L3]='Table'[Name],"L3",
    'Table'[L4]='Table'[Name],"L4"
)

vcgaomsft_0-1659408978287.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Anonymous
Not applicable

@unnijoy can you provide few more example of the data with the output you are looking for.

Above is the structure of ma table. Only thing i add extra is the Level Column.  In Name column i will have the name of the employe. The employee name will be in any one column from L1 - L4. So what i need to get the the column name under which the employee name is coming. In the above we can see that Max name is coming under L3 so i need to get L3 in Level Column. In excel we use to do this with Inded Match. But not sure how to do it in PowerBi.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.