Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Cómo mostrar el nombre del producto como producto más vendido por categoría y mes
Ene | Feb | Marzo | ... | ... | ... | .. | ... | ... | |
Categoría X | Producto X | Producto Z | Producto X | Producto x | Producto z | Producto t | así sucesivamente | así sucesivamente | así sucesivamente |
Categoría Y | Producto y | Producto S | Producto z | Producto y | Producto o | Producto r | así 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
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
Check out the November 2023 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |