cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Nombre del producto superior por categoría

Cómo mostrar el nombre del producto como producto más vendido por categoría y mes

EneFebMarzo.................
Categoría XProducto XProducto ZProducto XProducto xProducto zProducto tasí sucesivamente así sucesivamente así sucesivamente
Categoría YProducto yProducto SProducto zProducto yProducto oProducto rasí sucesivamente así sucesivamente así sucesivamente

Hice una matriz y muestra la multa total de ventas usando la siguiente medida

VAR RankingContext = VALORES ( DIM_WON_ANALYTICS[Producto] ) RETURN CALCULATE ( [Total Ventas], TOPN ( 1, ALL ( DIM_WON_ANALYTICS[Producto] ), [Total Ventas] ), RankingContext ) 

pero necesito mostrar el producto top 1 " Nombre "Estoy usando la siguiente medida pero devuelve los valores incorrectos.

FIRSTNONBLANK(TOPN(1,VALUES(DIM_WON_ANALYTICS[Product]),SUM(DIM_WON_ANALYTICS[Ingresos reales])),1)

Cómo puedo resolverlo

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Hola, por favor pruébelo:

TopProduct =
VAR RankingContext = VALUES(DIM_WON_ANALYTICS[Producto])
VAR TopProductSales = CALCULATE([Total Sales], TOPN(1, ALL(DIM_WON_ANALYTICS[Product]), [Total Sales]), RankingContext)
DEVOLUCIÓN
FIRSTNONBLANK(FILTER(DIM_WON_ANALYTICS, [Total Sales] = TopProductSales), [Producto])

Esta medida primero calcula las ventas totales de cada producto en el contexto de la categoría y el mes, luego utiliza la función TOPN para devolver el producto con las ventas más altas. A continuación, utiliza la función FILTRO para devolver el primer nombre de producto que no está en blanco que coincida con las ventas del producto superior.

Si funciona, por favor acéptelo como una solución




Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors