The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hola a todos, necesito de vuestra ayuda para contar los valores distintos que surgen de la combinación de dos campos.
estuve dando vueltas con la siguiente medida, pero no logro que funcione:
Cant_Cat_N2 =
CALCULATE(DISTINCTCOUNT(SELECTCOLUMNS(Clientes,
"Cliente_Grupo",
Venta[Nro_Client] & Venta[Grupo_Articulo])
))
Me ayudan?
Gracias @Anonymous y @bhanu_gautam
Las medidas funcionan, pero no me dan el resultado esperado.
Dos maneras de calcular lo que necesito:
1. La que me propusieron me da un total de 904.766
2. Si armo una columnaconcatenando los campos Nro_Cliente +Grupo_Articulo
y luego aplico la siguiente medida:
Hi @dieguil ,
Thank you for your feedback.
You can use the Summarize function in DAX to create a summarized table directly within your measure, avoiding the need to create a new concatenated column in your data table.
This approach helps to optimize memory usage and improve performance.
Here's an example of how you can achieve this:
Cantidad_Cliente_Grupo =
CALCULATE(
COUNTROWS(
SUMMARIZE(
Sale,
Sale[Nro_Client],
Sale[Grupo_Articulo]
)
)
)
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@bhanu_gautam muchas gracias por tu aporte, pero la función termina con el siguiente error:
La función DISTINCTCOUNT solo acepta una referencia de columna como argumento.
Hi @dieguil , hello bhanu_gautam, thank you for your prompt reply!
Please try the following measure to check if it meets your requirements:
Count_Combinations_Per_Client =
CALCULATE(
COUNTROWS(
SUMMARIZE(
RELATEDTABLE(Sale),
Sale[Nro_Client],
Sale[Grupo_Articulo]
)
)
)
Result for your reference:
Feel free to let me know if you need any further adjustments or additional help!
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@dieguil , Try using
Cant_Cat_N2 =
CALCULATE(
DISTINCTCOUNT(
SUMMARIZE(
Clientes,
Venta[Nro_Client],
Venta[Grupo_Articulo],
"Cliente_Grupo", Venta[Nro_Client] & Venta[Grupo_Articulo]
)
)
)
Proud to be a Super User! |
|
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
5 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |