Forum Discussion
Surya1
8 years agoHelper I
substring
Can someone help me.. I have a column1 like below: xy.xc.vc.20180302.txt df.hgf.h.2018.03.02.txt dfj_gf-2018.03.02.txt there is another column2 with the time details 20180402 15:30:...
- 8 years ago
Zubair_Muhammad
8 years agoCommunity Champion
Try this Column
Column =
VAR NumberPosition =
FIND ( 2, TableName[Col 1],, 0 )
VAR DotPosition =
FIND ( ".txt", TableName[Col 1],, 0 )
VAR MyNumbers =
SUBSTITUTE (
MID ( TableName[Col 1], NumberPosition, DotPosition - NumberPosition ),
".",
""
)
VAR MyYEAR =
LEFT ( MyNumbers, 4 )
VAR MyMonth =
MID ( MyNumbers, 5, 2 )
VAR MyDate =
MID ( MyNumbers, 7, 2 )
VAR spaceposition =
FIND ( " ", TableName[Col 2],, 0 )
VAR Time_Value =
TIMEVALUE (
MID (
TableName[Col 2],
spaceposition + 1,
LEN ( TableName[Col 2] ) - spaceposition
+ 1
)
)
RETURN
DATE ( MyYEAR, MyMonth, MyDate ) + TIMEVALUE ( Time_Value )- Zubair_Muhammad8 years agoCommunity Champion
- Surya18 years agoHelper I
Thank You.One more query.How can i add columns from two or more tables to a new a table.
I want to add col1 from table 1 and col1 and col3 from Table2 to a new table 3 using DAX
Table1 Table 2
col1 col2 col3 col1 col2 col3 col4 col5
Tabl3(New)
col1 col2 col3
- Zubair_Muhammad8 years agoCommunity Champion
Hi Surya1
You must have a common key to join them
If you dont have it....You can add an Index Column from Query Editor and then join the 2 tables on it
Then you can easily combine tables using "RELATED" Dax function