Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi there,
I have data where there are various distinctions of the same role category.
For example, Test Analyst: End to End, Test Analyst: Infrastructure, System Admin: DevOps, System Admin: Operati
ons, Training Manager, Operations Manager etc.
What would be the best way to create a column which aggregates these roles under the same category? For example, simply Test Analyst, System Admin and Managerial.
I know I could use multiple if statements or replace the values but this seems cumbersome and not like best practice.
Please find sample data below.
| Name | Dept | Role |
| Jane Doe | HR | Test Analyst End to End |
| John Smith | Research | IT Manager |
| Frank Frost | Strategy | Operations Manager |
| Sam Sun | Finances | System Admin Operations |
| Jack Jill | Engineering | Test Analyst Infrastructure |
| Dennis Menace | Finances | Finance Manager |
| Albert Einstein | Strategy | System Admin DevOps |
Thanks!
Solved! Go to Solution.
If roles are large in number, then it is better to maintain a mapping table. Then you can do a lookup on the mapping table.
I am not sure how many roles are there but on the basis of limited data whatever you have provided, following formula would work in a custom column
= if Text.Contains([Role],"Manager") then "Managerial" else Text.BeforeDelimiter([Role]," ",1)If roles are large in number, then it is better to maintain a mapping table. Then you can do a lookup on the mapping table.
I am not sure how many roles are there but on the basis of limited data whatever you have provided, following formula would work in a custom column
= if Text.Contains([Role],"Manager") then "Managerial" else Text.BeforeDelimiter([Role]," ",1)Thank you for this! I will try it out. Just for future reference, do you know of any useful references on the process of creating mapping tables?
Mapping table means this
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |