Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
any1 know what's wrong with this DAX?
Source = if(CONTAINS('Category-DataFlagType','Category-DataFlagType'[Type],"A"),"A",if(contains('Category-DataFlagType','Category-DataFlagType'[Type],"B"),"B",if(contains('Category-DataFlagType','Category-DataFlagType'[Type],"C"),"C",if(CONTAINS('Category-DataFlagType','Category-DataFlagType'[Type],"M"),"M","Other"))))
Solved! Go to Solution.
Hi @Anonymous
How about this version?
Source = SWITCH (
TRUE(),
FIND("A",'Category-DataFlagType'[Type],,0)>0,"A1",
FIND("B",'Category-DataFlagType'[Type],,0)>0,"B1",
FIND("C",'Category-DataFlagType'[Type],,0)>0,"C1",
FIND("M",'Category-DataFlagType'[Type],,0)>0,"M1",
---- ELSE -----
"OTHER")
Hi @Anonymous
You could try this approach
Source = IF(
'Category-DataFlagType'[Type] IN (
{"A","B","C","M"}
),
'Category-DataFlagType'[Type],
"Other"
)
@Phil_Seamark sorry, i maybe misleading, i actually want if value contain "A", then "A1", if value contain "B", then, "B1"....else "Other"
thanks
Hi @Anonymous
How about this version?
Source = SWITCH (
TRUE(),
FIND("A",'Category-DataFlagType'[Type],,0)>0,"A1",
FIND("B",'Category-DataFlagType'[Type],,0)>0,"B1",
FIND("C",'Category-DataFlagType'[Type],,0)>0,"C1",
FIND("M",'Category-DataFlagType'[Type],,0)>0,"M1",
---- ELSE -----
"OTHER")
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.