Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola a todos,
Tengo un problema con conseguir los totales correctos.
Estoy tratando de hacer comparación mes a mes para definir si el cliente ha dejado de pagar el contrato o hemos ganado el cliente (tasa de rotación). Hay varios tipos de productos y me gustaría tratarlos por separado.
Valor del mes anterior:
Amount PM = CALCULATE([Amount],DATEADD('Calendar'[Date],-1,MONTH))
Fórmula intermedia para definir si se trata de un cliente nuevo o perdido y para sumar:
z_int_Lost Customer Flag =
IF(
AND(
[Amount]<=0,[Amount PM]>0),
1,0)
z_int_New Customer Flag =
IF(
AND(
[Amount]>0,[Amount PM]=0),
1,0)
Aquí está mi solución de totales habituales, sin embargo, no funciona esta vez
Test 1 =
IF(
HASONEFILTER(Data[Customer]),
[z_int_Lost Customer Flag],
SUMX(VALUES(Data[Customer]),[z_int_Lost Customer Flag]))
También he probado 2 otras soluciones que se encuentran en línea, pero que no funcionan cualquiera de los.
Test 2 =
VAR _total = SUMMARIZE(Data,Data[Customer],'Calendar'[Year Month],'Product'[Product Group],"Lost",[z_int_Lost Customer Flag])
RETURN
IF(
HASONEFILTER(Data[Customer]),
[z_int_Lost Customer Flag],
SUMX(_total,[Lost]))
Test 3 = SUMX(SUMMARIZE(Data,Data[Customer],'Calendar'[Year Month],'Product'[Product Group],"Lost",[z_int_Lost Customer Flag]),[Lost])
Por último, he hecho una tabla separada con conectores de puente, como se describe en este post. Sin embargo, esta solución no es flexible y me gustaría evitarla.
Adjunto un PBIX de maqueta con el problema de totales replicados. Tiene idéntica estructura y medidas.
UPD: Se han añadido más datos al conjunto y a la opción propuesta.
¡Esperando tu ayuda!
Atentamente
Sergey
Solved! Go to Solution.
Ok, lo he descubierto.
He utilizado la solución propuesta por @richbenmintz y añadí un ajuste estándar para fijar subtotales y totales para año / trimestre / mes.
Hola @grechill,
Consulte el archivo adjunto, smaple.pbix
He creado una dimensión de cliente y luego he utilizado la siguiente medida
Lost Customers = CALCULATE(COUNTX('Customers', COUNTROWS('Customers')), filter('Customers', [Amount]<=0 && [Amount PM] > 0))
Espero que esto ayude,
Richard
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!
¿Mis respuestas ayudaron a llegar a una solución? Dale un kudos haciendo clic en Thumbs Up!
Proud to be a Super User!
Ok, lo he descubierto.
He utilizado la solución propuesta por @richbenmintz y añadí un ajuste estándar para fijar subtotales y totales para año / trimestre / mes.
Hi @richbenmintz ,
Sorry, I was too quick with assessment. It doesn't work. It shows subtotals, but they are incorrect. And it doesn't show totals at all.
I have updated data set with some data to test it and added your solution.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |