Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hello everyone,
I'm still new with the power query and PowerBI, and I was wondering if I can return the null value in column 1 with custom conditional column according to the grade in column 2.
Initially I was doing it like this, but something felt off about it......
= Table.AddColumn(#"Added Custom1", "Role", each if [C1] = "P1" or [C1] = "P2" or [C1] = "P3" or [C1] = "P4" or [C1] = "P3/P4" then "Executive" else if [C1] = "P5" or [C1] = "P6" then "Staff" else if [C1] = "P7" or [C1] = "P8" then "Principal" else if [C1] = "P9" or [C1] = "P10" then "GM" else if [C1] = "P11" or [C1] = "P12" or [C1] = "P11/P12" then "SGM" else if [C2] = "P1/P2" or [C2] = "P1" or [C2] = "P2" [C2] = "P3" or [C2] = "P3/P4" or [C2] = "P4" then "Executive" else if [C2] = "P5" or [C2] = "P5/P6" or [C2] = "P6" then "Staff" else if [C2] = "P7/P8" or [C2] = "P8" then "Principal" else if [C2] = "P9" or [C2] = "P10" then "GM" else if [C2] = "P11/P12" or [C2] = "P11" or [C2] = "P12" then "SGM" else null)
= Table.AddColumn(#"Added Custom1", "Role", each {null,"Executive","Staff","Principal", "GM","SGM"}{List.PositionOfAny({{"P1","P2","P3","P4"},{"P5","P6"} ,{"P7","P8"},{"P9","P10"},{"P11","P12"}},{[C1],[C2]},0,(x,y)=>List.ContainsAll(x,Text.Split(y??,"/")))+1})
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |