Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Name | Level | L1 | L2 | L3 | L4 |
Max | L3 | Rex | Lux | Max | Sam |
Sam | L2 | Max | Sam | Chris | Hex |
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.
Solved! Go to Solution.
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"
)
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
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"
)
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
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |