Forum Discussion
smpa01
Community Champion
6 years agoDoes DAX have anything equivalent to R's cbind?
Hello Experts,
Does DAX have anything that can replicate excatly what R's cbind does.
For example,
I have two tables as below
| Test | Test2 |
| A | A |
| A | A |
and
alpha
| 1 |
| 2 |
cbind in R can combine these two columns to create a new table as below
| Test | Test2 | alpha |
| A | A | 1 |
| B | A | 2 |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSAeJYHTgrFgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Test = _t, Test2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Test", type text}}),
#"Run R script" = R.Execute("# 'dataset' holds the input data for this script#(lf)df1<- data.frame(alpha=c(1:2))#(lf)df2<- cbind(dataset,df1)#(lf)df2",[dataset=#"Changed Type"]),
df2 = #"Run R script"{[Name="df2"]}[Value]
in
df2
Can this be replicated using anything in DAX by any chance?
Thank you in advance .
3 Replies
- AnonymousNot applicable
Hello-
This is probably going to be best done in PowerQuery. My suggestion would be to merge the columns and then expand "alpha" to combine these 2 tables.
Jared
- smpa01
Community Champion
Anonymous thanks for the reply. I know how it can be done in M. Just wondering if DAX has this capacity?
- stevedep
Memorable Member