Forum Discussion
Problem with calcul
- 6 months ago
Hi FP68
here the correct code
ApplicationName =VAR TagText = Disques_Global[TAGS]VAR _Key = "ApplicationName="VAR KeyPos = SEARCH ( _Key, TagText, 1, 0 )VAR ValueStart = KeyPos + LEN ( Key )VAR SemiPos = SEARCH ( ";", TagText, ValueStart, 0 )RETURNIF (KeyPos = 0,BLANK(),IF (SemiPos = 0,MID ( TagText, ValueStart, LEN ( TagText ) - ValueStart + 1 ),MID ( TagText, ValueStart, SemiPos - ValueStart )))If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your threadWant to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
No SemiColonPos is the posiion of ";" after the word ApplicationName
with ".......;ApplicationName=.......;.....", could you confirm the comments in red:
Countries2 =
VAR _x = SEARCH ( "ApplicationName=" , [TAGS] , 1 , 0 )
VAR _z = _x + LEN ( "ApplicationName=" )
VAR SemiColonPos = SEARCH ( ";" , [TAGS] , _z , 0 )
RETURN SemiColonPos //returns 8?
ApplicationName =
var _x = find("ApplicationName",[TAGS],1,0) //_x returns 9?
var _y = Disques_Global[Countries2] - _x //_y return -1?
var _z = MID (Disques_Global[Tags], _x,_y)
return _z
- FP687 months agoHelper I
Countries2 = 32 ==> position of ";" after "ApplicationName"
_x = 9 ==> position of "ApplicationName"
_y = 32 -9 = 23 ==> length of the chain to extract