Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Necesidad de crear una tabla a partir de las tablas existentes y unir los datos

Hola a todos

Tengo 2 tablas A y B necesitan crear la tabla C de la A y B

En una tabla tengo 4 columnas

En la tabla B tengo 4 columnas

Para crear una tabla C Necesita datos distintos de 2 columnas de una tabla y datos distintos 2 columnas en la tabla B y unión de los datos.

datos de muestra

Tabla A
EmpId Fecha servicio no Móvil
5221/05/20201256695845213
7542/4/2020526458964125
856911/2/202025635289654
856911/2/202025635289654
2565/5/2020852659641253

Tabla B
EmpId Fecha rollo de sal
20121/05/2020Null5
5552/4/2020Null6
77711/2/2020Null4
77711/2/2020Null5
255/5/2020Null2

Necesidad de crear la Tabla C
EmpId Fecha DateKeyEmpID+DateKey
5221/05/2020210520205221052020
7542/4/2020242020754242020
856911/2/2020112202085691122020
2565/5/2020552020256552020
20121/05/20202105202020121052020
5552/4/2020242020555242020
77711/2/202011220207771122020
255/5/202055202025552020

¿Puede alguien ayudarme a crear un modelo tabular SSAS

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Venkateswara_ra

puede intentar usar DAX para crear una nueva tabla

Table C = 
VAR A=ADDCOLUMNS(SUMMARIZE('Table A','Table A'[EmpId ],'Table A'[Date ],"datekey",day('Table A'[Date ])&month('Table A'[Date ])&year('Table A'[Date ])),"empid+datekey",'Table A'[EmpId ]&[datekey])
VAR B=ADDCOLUMNS(SUMMARIZE('Table B','Table B'[EmpId ],'Table B'[Date ],"datekey",day('Table B'[Date ])&month('Table B'[Date ])&year('Table B'[Date ])),"empid+datekey",'Table B'[EmpId ]&[datekey])
return UNION(A,B)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@Venkateswara_ra

puede intentar usar DAX para crear una nueva tabla

Table C = 
VAR A=ADDCOLUMNS(SUMMARIZE('Table A','Table A'[EmpId ],'Table A'[Date ],"datekey",day('Table A'[Date ])&month('Table A'[Date ])&year('Table A'[Date ])),"empid+datekey",'Table A'[EmpId ]&[datekey])
VAR B=ADDCOLUMNS(SUMMARIZE('Table B','Table B'[EmpId ],'Table B'[Date ],"datekey",day('Table B'[Date ])&month('Table B'[Date ])&year('Table B'[Date ])),"empid+datekey",'Table B'[EmpId ]&[datekey])
return UNION(A,B)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.