Operations on multiple tables / datasets using Edit Queries and R in Power BI

I have two tables (tbl_A and tbl_B) in a Power BI file that I would like to convert and analyze using the Run R Script function in Edit Queries .

enter image description here

This will include handling missing values ​​and joining tables. However, when starting R, it seems that I can only perform operations on one table at a time. This is because the Run R Script function only imports data from a table that is active when you click the Run R Script button. This data is then stored in the dataset variable .

enter image description here

, , R Power BI . , , R. , , , , . , R Power BI?

+3
1

:

R script [dataset = "Renamed Columns", dataset2 = tbl_A] . ( ), R script, tbl_A , . .


, , - PowerBI:

. /. . , ...

enter image description here

/ . . Public:

enter image description here


:

, , PowerBI - . Excel, , tbl_A tbl_B, . :

tbl_A

Date        Price1  Price2
05.05.2016  23,615  24,775
04.05.2016  23,58   24,75
03.05.2016  0       24,35
02.05.2016  22,91   24,11
29.04.2016  22,93   24,24

tbl_A

enter image description here

tbl_B

Date        Price3  Price4
02.06.2016  19,35   22,8
01.06.2016  19      22,35
31.05.2016  19,35   22,71
30.05.2016  15,5    21,85
27.05.2016  19,43   22,52

tbl_B

enter image description here


PowerBI tbl_A :

enter image description here

tbl_B, :

enter image description here

"" , . , :

enter image description here

, , PowerBI . :

enter image description here

, PowerBI , , Date. . , :

enter image description here

, , , tbl_B , . , Type1:

enter image description here

, R script. script rbind(). , . , B Price3 Price4 Price1 Price2, :

enter image description here

:

enter image description here

, ( ), R script. , , .

R Script. , dataset script. tbl_B , tbl_B R Script:

enter image description here

script , OK :

enter image description here

. -, , . -, , tbl_B , . , , . , , dataset2=tbl_A, :

enter image description here

Enter.

" " , , R script:

enter image description here

, R :

df_B <- dataset
df_A <- dataset2
df_temp <- rbind(df_A, df_B)

output <- df_temp

OK, , :

enter image description here

, , .

!

enter image description here

, . R script , :

enter image description here

tbl_B tbl_A. , , R script, R .

+1

Source: https://habr.com/ru/post/1693669/


All Articles