Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
JordiGrau
New Member

Suma Total incorrecto en columna de What If

Hola,

 

Estoy calculando una hipótesis con la medida What If. Funciona bien pero no calcula correctamente el total.

 

Utilizo la siguiente medida:

 

M-HIPOTPol = if (SELECTEDVALUE ('725assa vtiger_potential' [potencialtype]) = "Prospecto Cliente"; [M_CuentaPol] * [Valor HIPOTNumPolizas]; ([M_CuentaPol]))
 
El total de la columna M-HIPOTPol es incorrecto y no puedo resolver el problema. 
PwBI-WhatIf.png
Agradeceré vuestra ayuda
 
Saludos
 
Jordi
1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@JordiGrau 

Mantén la medida que has escrito y prueba con:

M-HIPOTPol (totales) = SUMX(

                                         SUMMARIZE('725assa vtiger_potential';

                                            '725assa vtiger_potential' [potentialtype] ;

                                            "ConTotal"; [M-HIPOTPol]);

                                                   [ConTotal])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

@JordiGrau 

Mantén la medida que has escrito y prueba con:

M-HIPOTPol (totales) = SUMX(

                                         SUMMARIZE('725assa vtiger_potential';

                                            '725assa vtiger_potential' [potentialtype] ;

                                            "ConTotal"; [M-HIPOTPol]);

                                                   [ConTotal])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

Every multiplication happen it needs to happen at the line level. The grand totals are calculated again; so need to make sure that if measures are used GT calculated from lines

 

You have to something like this

M-HIPOTPol = sumx(values('725assa vtiger_potential' [potencialtype]),if (SELECTEDVALUE ('725assa vtiger_potential' [potencialtype]) = "Prospecto Cliente"; [M_CuentaPol] * [Valor HIPOTNumPolizas]; ([M_CuentaPol])))
kentyler
Solution Sage
Solution Sage

PwBI-WhatIf.png

Los totales no funcionen in power bi como en excel. cuando el medida calcula en el row "total" no va hayar ningun "potentialtype" selectionada... as siempre va regresar el M_CuentaPol
debe ser algo asi

VAR total = calculate(sum('725assa vtiger_potential' [potencialtype]),ALL('725assa vtiger_potential' ))

M-HIPOTPol = if (SELECTEDVALUE ('725assa vtiger_potential' [potencialtype]) = "Prospecto Cliente"; [M_CuentaPol] * [Valor HIPOTNumPolizas]; [total])

donde el ALL() quita todos filtros en el columna, asi que el SUM() agare los valores de todas las filas

 

Soy un entrenador personal de Power Bi. Aprendo algo cada vez que respondo una pregunta.
Las reglas de oro para Power BI
1. Use una tabla de calendario. Es preferible usar tablas de fecha personalizadas que usar las capacidades de manejo automático de fecha / hora de Power BI. https://www.youtube.com/watch?v=FxiAYGbCfAQ
2. Cree su modelo de datos como un esquema estelar. ¡Crear un esquema estrella en Power BI es la mejor práctica para mejorar el rendimiento y, lo que es más importante, para garantizar resultados precisos! https://www.youtube.com/watch?v=1Kilya6aUQw
3. Use una pequeña muestra de datos de configuración al desarrollar. Cuando construya sus medidas y columnas calculadas, use siempre una pequeña cantidad de datos de muestra para que sea más fácil confirmar que está obteniendo los números correctos.
4. Almacene todos sus cálculos intermedios en VAR cuando escriba medidas. Puede devolver estos VAR intermedios en lugar de su resultado final para verificar sus pasos en el camino.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.