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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SantiagoP29
Frequent Visitor

Sumar cantidades de acuerdo a dos fechas

Buenas tardes,

 

Agradezco su ayuda para lograr una vizualización que no he podido generar por favor.

Cuento con dos tablas en Power bi llamadas contrataciones y levantamientos, que contienen las siguientes columnanas:

Contrataciones: Fecha de contratacion, producto, territorio.

Levantamientos: Fecha de levantamiento, ID, territorio.

 

Como ven, estas dos tablas no tienen una llave entre ellas y se quiere mostrar en un grafico la cantidad de contrataciones y levantamietos respecto a las fechas, ejemplo:

 

Colocando en el eje x el mes y dia de levantamientos se quiere mostrar la cantidad de levantamientos y la cantidad de contrataciones que su fecha de contratacion fue igual a la fecha de levantamiento. 

Este es un ejemplo:

 

Tabla inspecciones: 

SantiagoP29_0-1709672577747.png

 

Tabla Contrataciones:

SantiagoP29_1-1709672591732.png

 

Resultado esperado:

SantiagoP29_2-1709672611044.png

Esto con el fin de cuando se genere un gráfico y se coloque en el Eje x la fecha se pueda tener el resultado correcto de lo que fue levantado y contratado en esa fecha.

 

Agradezco cualquier ayuda para lograr esto por favor.

 

 

1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @SantiagoP29 ,

The Table data is shown below:

vzhouwenmsft_5-1709697981449.png

 

 

vzhouwenmsft_6-1709698008268.png

 

Please follow these steps:
1. Use the following DAX expression to create a table

Result_Table = SUMMARIZE(UNION('inspecciones','contrataciones'),
     'inspecciones'[Date],
     "inspecciones",COALESCE(SUMX(FILTER('inspecciones','inspecciones'[Date] = EARLIER('inspecciones'[Date])), 1), 0),
     "contrataciones", COALESCE(SUMX(FILTER('contrataciones', 'contrataciones'[Date] = EARLIER('inspecciones'[Date])), 1), 0) )

2. Final output

vzhouwenmsft_2-1709696825847.png

vzhouwenmsft_4-1709696873007.png

 

 


Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-zhouwen-msft
Community Support
Community Support

Hi @SantiagoP29 ,

The Table data is shown below:

vzhouwenmsft_5-1709697981449.png

 

 

vzhouwenmsft_6-1709698008268.png

 

Please follow these steps:
1. Use the following DAX expression to create a table

Result_Table = SUMMARIZE(UNION('inspecciones','contrataciones'),
     'inspecciones'[Date],
     "inspecciones",COALESCE(SUMX(FILTER('inspecciones','inspecciones'[Date] = EARLIER('inspecciones'[Date])), 1), 0),
     "contrataciones", COALESCE(SUMX(FILTER('contrataciones', 'contrataciones'[Date] = EARLIER('inspecciones'[Date])), 1), 0) )

2. Final output

vzhouwenmsft_2-1709696825847.png

vzhouwenmsft_4-1709696873007.png

 

 


Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.