Forum Discussion
FP68
Helper I
7 months agoProblem with calcul
Hello the community, I try to extract a chain of caracters from a columns and I don't understand why I've the message "an argument of function MID has the wrong data type or has an invalid value"...
- 7 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
FBergamaschi
Super User
7 months agoHi 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 )
RETURN
IF (
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
- FP687 months ago
Helper I
Thanks a lot Frnacesco and thanks to all