Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hola, como estan,
agradeceria que me puede ayudar en esto, quiero obtener la participación de un proveedor solo en las categorias en donde participa. Por ejemplo: este proveedor tiene ventas en 3 categorias pero el total de categorias son 11 considerando todos los proveedores, entonces necesito obtener la particpación por cada categoria del proveedor filtrado entre el total de la misma categoria donde participan todos los proveedores, quiero obtener esto a nivel categorias y a nivel total.
Tabla original:
Nombre Proveedor | Nombre Linea | Vta Proveedor | Vta todos los proveedores | Part% Prv |
PEPITO | ACCESORIOS DEL HOGAR | 1,386,781 | ||
PEPITO | ACCESORIOS MODA | 148,051 | ||
PEPITO | ACCESORIOS TV | 23,391 | ||
PEPITO | ACEITES | 4,581,561 | 10,363,962 | 44.2% |
PEPITO | AGUAS | 4,539,345 | ||
PEPITO | ALIMENTOS | 5,646 | 3,380,543 | 0.2% |
PEPITO | ALIMENTOS DE BEBES | 394,945 | ||
PEPITO | ARROZ | 8,821,884 | ||
PEPITO | AUDIFONOS | 60,395 | ||
PEPITO | AUTOMOTOR | 10,072 | 316,807 | 3.2% |
PEPITO | AZUCAR | 4,518,614 | ||
Total | 4,597,280 | 33,954,717 | 13.5% | |
Tabla que se requiere:
Nombre Proveedor | Nombre Linea | Vta Proveedor | Vta todos los proveedores | Part% Prv |
PEPITO | ACEITES | 4,539,345 | 10,363,962 | 44.2% |
PEPITO | ALIMENTOS | 5,646 | 3,380,543 | 0.2% |
PEPITO | AUTOMOTOR | 10,072 | 316,807 | 3.2% |
Total | 4,597,280 | 14,061,312 | 32.7% | |
Solved! Go to Solution.
Hi @aluyoq,
It sound like a common measure formula calculate with multiple aggregation issue.
For this scenario, you can refer to the Greg’s blog to add a variable table with summarize function to apply the first level aggregation, then use iterator function sumx to aggregate the second level.
Measure Totals, The Final Word
formula =
VAR summary =
SUMMARIZE (
ALLSELECTED ( Tabla ),
[Nombre Proveedor],
[Nombre Linea],
"Result",
CALCULATE (
DIVIDE (
SUM ( Tabla[Vta Proveedor] ),
SUM ( Tabla[Vta todos los proveedores] )
),
ALLSELECTED ( Tabla ),
VALUES ( Tabla[Nombre Proveedor] ),
VALUES ( Tabla[Nombre Linea] )
)
)
RETURN
SUMX ( summary, [Result] )
Regards,
Xiaoxin Sheng
HI @aluyoq,
You can try to use the following measure formula to calculate the percentage based on current category(Nombre Proveedor, Nombre Linea) groups:
formula =
CALCULATE (
DIVIDE (
SUM ( Tabla[Vta Proveedor] ),
SUM ( Tabla[Vta todos los proveedores] )
),
ALLSELECTED ( Tabla ),
VALUES ( Tabla[Nombre Proveedor] ),
VALUES ( Tabla[Nombre Linea] )
)
Regards,
Xiaoxin Sheng
Hola, las participaciones por linea estan perfectas pero el total de participación no es el correcto porque esta calculando sobre el total de ventas de todos los proveedores, es decir sale como total 13.5% deberia salir 32.7%, podria ser porque para calcular la "Vta todos los proveedores" utilizo la siguiente formula
La Tabla esta saliendo de la siguiente manera:
Nombre Proveedor | Nombre Linea | Vta Proveedor | Vta todos los proveedores | Part% Prv |
PEPITO | ACEITES | 4,539,345 | 10,363,962 | 44.2% |
PEPITO | ALIMENTOS | 5,646 | 3,380,543 | 0.2% |
PEPITO | AUTOMOTOR | 10,072 | 316,807 | 3.2% |
Total | 4,597,280 | 33,954,717 | 13.5% | |
De salir como Total | 4,597,280 | 14,061,312 | 32.7% |
Hi @aluyoq,
It sound like a common measure formula calculate with multiple aggregation issue.
For this scenario, you can refer to the Greg’s blog to add a variable table with summarize function to apply the first level aggregation, then use iterator function sumx to aggregate the second level.
Measure Totals, The Final Word
formula =
VAR summary =
SUMMARIZE (
ALLSELECTED ( Tabla ),
[Nombre Proveedor],
[Nombre Linea],
"Result",
CALCULATE (
DIVIDE (
SUM ( Tabla[Vta Proveedor] ),
SUM ( Tabla[Vta todos los proveedores] )
),
ALLSELECTED ( Tabla ),
VALUES ( Tabla[Nombre Proveedor] ),
VALUES ( Tabla[Nombre Linea] )
)
)
RETURN
SUMX ( summary, [Result] )
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |