Forum Discussion
toum
3 years agoHelper II
Matche DAX
Hello, Could you pleaqe tell me how I can convert this code to DAX SEARCH("^[A-Za-z]{5}@[0-9]{2} .*", [Column], , , , 1) = 1, TRUE(), FALSE())
- 3 years ago
Here is a DAX solution using "DAX loops :D"
VAR textNew = UPPER('Table'[Column1])VAR alphabet = SELECTCOLUMNS(GENERATESERIES(UNICODE("A"), UNICODE("Z")), "@Char", UNICHAR([Value]))VAR numbers = SELECTCOLUMNS(GENERATESERIES(0, 9, 1), "@Char", [Value])VAR characters = UNION(alphabet, numbers, ROW("@Char", "@"))VAR textLength = LEN(textNew)VAR numTable = SELECTCOLUMNS(GENERATESERIES(1, textLength, 1), "@Num", [Value])VAR charTable = ADDCOLUMNS(numTable, "@Char", MID(textNew, [@Num], 1))VAR checkTable =ADDCOLUMNS(charTable,"@Check",IF([@Char] IN characters, 0, 1))VAR countValues = SUMX(checkTable, [@Check])RETURN {IF(countValues > 0, TRUE())}
Screenshot has the formula with commnets:
PawelWrona
3 years agoResolver II
Here is a DAX solution using "DAX loops :D"
VAR textNew = UPPER('Table'[Column1])
VAR alphabet = SELECTCOLUMNS(GENERATESERIES(UNICODE("A"), UNICODE("Z")), "@Char", UNICHAR([Value]))
VAR numbers = SELECTCOLUMNS(GENERATESERIES(0, 9, 1), "@Char", [Value])
VAR characters = UNION(alphabet, numbers, ROW("@Char", "@"))
VAR textLength = LEN(textNew)
VAR numTable = SELECTCOLUMNS(GENERATESERIES(1, textLength, 1), "@Num", [Value])
VAR charTable = ADDCOLUMNS(numTable, "@Char", MID(textNew, [@Num], 1))
VAR checkTable =
ADDCOLUMNS(
charTable,
"@Check",
IF([@Char] IN characters, 0, 1)
)
VAR countValues = SUMX(checkTable, [@Check])
RETURN {IF(countValues > 0, TRUE())}
Screenshot has the formula with commnets:
Screenshot has the formula with commnets:
toum
3 years agoHelper II
Can you send me the pbix please
- PawelWrona3 years agoResolver II
Sure, here it is 🙂
https://drive.google.com/file/d/1ExioyflVzkMhcxArrW0O2-Ia7_Y0sop8/view?usp=share_link