This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hey guys
I'm trying to label some product here by their codes on my power query editor.
I want to label every codes that starts with "21" except the ones that starts with "212".
Something like this:
if Text.StartsWith([#"CC#"] , "21") EXCEPT Text.StartsWith([#"CC#"] , "212") then "Product A"
if Text.StartsWith([#"CC#"] , "212") then "Product B"
Can anyone help me?
Thanks a lot
Pedro
Solved! Go to Solution.
@Anonymous Please try this..
= Table.AddColumn(#"Changed Type", "Result", each if Text.StartsWith([Data], "212") then "Product B" else if Text.StartsWith([Data], "21") then "Product A" else "Other")
Proud to be a PBI Community Champion
@Anonymous Please try this..
= Table.AddColumn(#"Changed Type", "Result", each if Text.StartsWith([Data], "212") then "Product B" else if Text.StartsWith([Data], "21") then "Product A" else "Other")
Proud to be a PBI Community Champion
Cool!!!!
Thank you so much!!
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 26 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 39 | |
| 33 | |
| 24 | |
| 23 |