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
Anonymous
Not applicable

mostrar datos en dos fechas en una tabla

hola expertos,

Tengo un conjunto de datos como el de abajo,

FechaProductidCategoríaCantidad
10/31/2019101A10
10/31/2019102A12
10/31/2019103B110
12/31/2019101A15
12/31/2019102A14
12/31/2019104C20
4/30/2020101A15
4/30/2020102B110
4/30/2020105B50
............

Básicamente, en diferentes fechas, tenemos algunos productos, y cada producto se clasifica en grupos, sin embargo, la categorización puede cambiar de fecha a fecha. Por ejemplo, en el cuadro anterior, el producto 102 estaba en el Grupo A el 10/31/2019, pero en el Grupo B el 4/30/2020

Ahora quiero crear un panel, en este panel, necesito dos filtros en la fecha, Date1 y Date2, para que los usuarios puedan elegir dos fechas para comparar. Por ejemplo, puedo elegir 4/30/2020 en el filtro Date1 y elegir 10/31/2019 en el filtro Date2, luego quiero mostrar los datos en una tabla en el siguiente formato:

ProductidCategoría Fecha 1Fecha1 ImporteCategoría Fecha 2Fecha 2 Importe
101A10A15

102

A12B110
103B110
105 B50

¿Cómo puedo lograrlo?

Gracias

Miguel

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

Hola @msmichael ,

Deberá crear dos tablas de segmentación de datos y cuatro medidas.

slicer1 = DISTINCT('Table'[Date])

slicer2 = DISTINCT('Table'[Date])
Date1 Category = CALCULATE(SELECTEDVALUE('Table'[Category]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer1[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Date1 Amount = CALCULATE(SELECTEDVALUE('Table'[Amount]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer1[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Date2 Category = CALCULATE(SELECTEDVALUE('Table'[Category]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer2[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Date2 Amount = CALCULATE(SELECTEDVALUE('Table'[Amount]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer2[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Utilice la columna de fecha de estas dos tablas de segmentación de datos y el resultado se mostrará como se muestra a continuación.

1.PNG

Saludos

Jay

Equipo de apoyo a la comunidad _ Jay Wang

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

5 REPLIES 5
v-jayw-msft
Community Support
Community Support

Hola @msmichael ,

Deberá crear dos tablas de segmentación de datos y cuatro medidas.

slicer1 = DISTINCT('Table'[Date])

slicer2 = DISTINCT('Table'[Date])
Date1 Category = CALCULATE(SELECTEDVALUE('Table'[Category]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer1[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Date1 Amount = CALCULATE(SELECTEDVALUE('Table'[Amount]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer1[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Date2 Category = CALCULATE(SELECTEDVALUE('Table'[Category]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer2[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Date2 Amount = CALCULATE(SELECTEDVALUE('Table'[Amount]),FILTER(ALLSELECTED('Table'),'Table'[Date]=SELECTEDVALUE(slicer2[Date])&&'Table'[ProductId]=SELECTEDVALUE('Table'[ProductId])))

Utilice la columna de fecha de estas dos tablas de segmentación de datos y el resultado se mostrará como se muestra a continuación.

1.PNG

Saludos

Jay

Equipo de apoyo a la comunidad _ Jay Wang

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
vanessafvg
Super User
Super User

¿Habrá sólo 2 categorías?

puede agrupar un suceder y luego agrupar un de nuevo?

¿cuál es la regla para la secuencia, cuál es el patrón?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Hola

Gracias por su respuesta.

Habrá muchas categorías, y el número total de categorías son desconocidas, siempre podemos tener nuevas categorías también.

Un producto se puede clasificar en el grupo A el día 1 y clasificarse en el grupo B el día 2, y clasificarse de nuevo en el grupo A el día 3, y así sucesivamente.

No hay ningún patrón sobre cómo se clasifica el producto. Simplemente tratamos la categoría como un atributo de productos.

Gracias

Miguel

por lo que la secuencia / patrón es entonces la fecha, fecha 1 - 1 , fecha 2 - 2 por lo que necesita ser ordenado por fecha y puede tener una cantidad variable de fechas?




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

hola vanessafvg,

Sí puede haber una cantidad variable de fechas, ahora mismo tenemos fechas de un año.

Gracias

Miguel

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.