Forum Discussion
Concatenates
- Anonymous2 years ago
Hi Alma1992 ,
You can follow these steps below:
1.Add a new column.
CodeNumber = VAR code = REPLACE ( [Country Code], 1, 4, "" ) VAR result = LEFT ( code, SEARCH ( ")", code ) - 1 ) RETURN resultChange the Data Type to Whole Number:
2.Add a new column.
PhoneNumber = IF ( 'Table'[CodeNumber] < 10, LEFT ( 'Table'[Phone], 1 ), LEFT ( 'Table'[Phone], 2 ) )Change the Data Type to Whole Number:
3.Add a new column.
FinalResult = IF ( 'Table'[CodeNumber] = 'Table'[PhoneNumber], "+" & 'Table'[Phone], "+" & 'Table'[CodeNumber] & 'Table'[Phone] )Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Alma1992 ,
You can follow these steps below:
1.Add a new column.
CodeNumber =
VAR code =
REPLACE ( [Country Code], 1, 4, "" )
VAR result =
LEFT ( code, SEARCH ( ")", code ) - 1 )
RETURN
result
Change the Data Type to Whole Number:
2.Add a new column.
PhoneNumber =
IF (
'Table'[CodeNumber] < 10,
LEFT ( 'Table'[Phone], 1 ),
LEFT ( 'Table'[Phone], 2 )
)
Change the Data Type to Whole Number:
3.Add a new column.
FinalResult =
IF (
'Table'[CodeNumber] = 'Table'[PhoneNumber],
"+" & 'Table'[Phone],
"+" & 'Table'[CodeNumber] & 'Table'[Phone]
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.