Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hola
Estoy tratando de obtener filas únicas para uno de mis orígenes de datos. Los datos tienen este aspecto:
Y me gustaría tener una mesa como esta:
Notas:
En mis datos originales, no todos los productos tienen 2 líneas
Tengo varias columnas con este mismo propósito, así que me gustaría una solución que funcione en una base de datos más grande
Gracias de antemano (:
Solved! Go to Solution.
Hola @GabrielFz ,
Según mi prueba, la expresión @amitchandak proporcionada es un poco problemática. Por favor, modifíquelo así:
Table 2 =
VAR t =
SELECTCOLUMNS (
'Table',
"Product", 'Table'[product],
"Quantity A", IF ( 'Table'[Location] = "A", 'Table'[Quantity], BLANK () ),
"Quantity B", IF ( 'Table'[Location] = "B", 'Table'[Quantity], BLANK () ),
"Delivery Date A", IF ( 'Table'[Location] = "A", 'Table'[Delivery Date], BLANK () ),
"Delivery Date B", IF ( 'Table'[Location] = "B", 'Table'[Delivery Date], BLANK () ),
"Color", 'Table'[Color]
)
RETURN
SUMMARIZE (
t,
[product],
[Color],
"Quantity A", SUMX ( t, [Quantity A] ),
"Quantity B", SUMX ( t, [Quantity B] ),
"Delivery Date A", MAXX ( t, [Delivery Date A] ),
"Delivery Date B", MAXX ( t, [Delivery Date B] )
)
Saludos
Icey
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola @GabrielFz ,
Según mi prueba, la expresión @amitchandak proporcionada es un poco problemática. Por favor, modifíquelo así:
Table 2 =
VAR t =
SELECTCOLUMNS (
'Table',
"Product", 'Table'[product],
"Quantity A", IF ( 'Table'[Location] = "A", 'Table'[Quantity], BLANK () ),
"Quantity B", IF ( 'Table'[Location] = "B", 'Table'[Quantity], BLANK () ),
"Delivery Date A", IF ( 'Table'[Location] = "A", 'Table'[Delivery Date], BLANK () ),
"Delivery Date B", IF ( 'Table'[Location] = "B", 'Table'[Delivery Date], BLANK () ),
"Color", 'Table'[Color]
)
RETURN
SUMMARIZE (
t,
[product],
[Color],
"Quantity A", SUMX ( t, [Quantity A] ),
"Quantity B", SUMX ( t, [Quantity B] ),
"Delivery Date A", MAXX ( t, [Delivery Date A] ),
"Delivery Date B", MAXX ( t, [Delivery Date B] )
)
Saludos
Icey
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@GabrielFz, crear una nueva tabla como
summarize(
selectcolumns(Table,"Product", Table[product],"Quantity A",if(Table[Location] ="A",Table[Quantity],blank())
,"Quantity B",if(Table[Location] ="B",Table[Quantity],blank())
,"Delivery Date A",if(Table[Location] ="A",Table[Delivery Date],blank())
,"Delivery Date B",if(Table[Location] ="B",Table[Delivery Date],blank())
,"Color", table[Color]),[product],[Color],"Quantity A",sum([Quantity A]),"Quantity B",sum([Quantity B])
,"Delivery Date A",max([Delivery Date A]),"Delivery Date B",Max([Delivery Date B]))
The Power BI Data Visualization World Championships is back! It's time to submit your entry.