Forum Discussion
markefrody
Post Patron
3 years agoSetting Up Conditional Column Using Alpha Numeric ID
Hi Sirs, I am trying to create a "Classification" column wherein I try to classify the following alpha numeric: 1.) If ID starts with "MBKX" classify as "Private" 2.) If ID starts with "SMIX" ...
- 3 years ago
you can try this to create a measure
Measure = var _mbkx=IFERROR(find("MBKX",MAX('Table'[ID])),0) var _smix=IFERROR(find("SMIX",MAX('Table'[ID])),0) var _sub=len(SUBSTITUTE(MAX('Table'[ID]),"SMIX","")) return if(_mbkx>0,"Private",if(_smix>0&&_sub>=5,"Private","Public"))
markefrody
Post Patron
3 years agoHi ryan_mayu. Thank you for your assistance. I have tried using the DAX code but it seems not to work on my side. "IFERROR" seems to be not recognized. Did you create "New Measure" or "New Column" for the DAX?
By the way, I am using Storage Mode: Direct Query.
ryan_mayu
Super User
3 years agoyou can try this to create a measure
Measure =
var _mbkx=IFERROR(find("MBKX",MAX('Table'[ID])),0)
var _smix=IFERROR(find("SMIX",MAX('Table'[ID])),0)
var _sub=len(SUBSTITUTE(MAX('Table'[ID]),"SMIX",""))
return if(_mbkx>0,"Private",if(_smix>0&&_sub>=5,"Private","Public"))