Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Beginner at Power BI 🙂
Have this Issue -
Below is the query that have been using it to categorize the product type as GFT and LT (So if Product Code contains GRF,GR,GF they are tagged as GFT and otherwise LT)
Existing working Query-
Solved! Go to Solution.
Try:
Category =
SWITCH (
TRUE (),
CONTAINSSTRINGEXACT ( myp[Product Code], "GRF" ), "GFT",
CONTAINSSTRINGEXACT ( myl[Session], "GR" ), "GFT",
CONTAINSSTRINGEXACT ( myp[Product Code], "-GF" ), "GFT",
CONTAINSSTRINGEXACT ( myp[Product Code], "TG" ), "GFT",
CONTAINSSTRINGEXACT ( myp[Product Code], "-TG" ), "GFT",
myp[Product Code] = "A54958", "GFT",
"LT"
)
Proud to be a Super User!
Paul on Linkedin.
Thanks Paul for your quick help
Try:
Category =
SWITCH (
TRUE (),
CONTAINSSTRINGEXACT ( myp[Product Code], "GRF" ), "GFT",
CONTAINSSTRINGEXACT ( myl[Session], "GR" ), "GFT",
CONTAINSSTRINGEXACT ( myp[Product Code], "-GF" ), "GFT",
CONTAINSSTRINGEXACT ( myp[Product Code], "TG" ), "GFT",
CONTAINSSTRINGEXACT ( myp[Product Code], "-TG" ), "GFT",
myp[Product Code] = "A54958", "GFT",
"LT"
)
Proud to be a Super User!
Paul on Linkedin.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!