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! necesito ayuda con el cálculo de una división porcentual. En particular, tengo una matriz con una primera columna de ciertos productos, luego la cantidad de salas y luego necesito que haya una columna con el porcentaje de esa cantidad sobre el total, pero dependiendo de la región. Probé con la fórmula con la función all y allselected pero por alguna razón que desconozco el valor que me arrojan en el % no es el correcto.
Espero puedan ayudarme. Gracias de antemano!
Solved! Go to Solution.
Hi, @Anonymous
Try to use the ALLEXCEPT function
I created a simple sample file like below, is this the result you want?
Measures:
_Per of Region =
VAR _countofRoom =
SUM ( [Count of Room] )
VAR _Region =
CALCULATE ( SUM ( [Count of Room] ), ALLEXCEPT ( 'Table', 'Table'[Region] ) )
RETURN
DIVIDE ( _countofRoom, _Region )
_Per of Total =
VAR _count =
SUM ( 'Table'[Count of Room] )
VAR _total =
CALCULATE ( SUM ( 'Table'[Count of Room] ), ALL ( 'Table' ) )
RETURN
DIVIDE ( _count, _total )
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Try to use the ALLEXCEPT function
I created a simple sample file like below, is this the result you want?
Measures:
_Per of Region =
VAR _countofRoom =
SUM ( [Count of Room] )
VAR _Region =
CALCULATE ( SUM ( [Count of Room] ), ALLEXCEPT ( 'Table', 'Table'[Region] ) )
RETURN
DIVIDE ( _countofRoom, _Region )
_Per of Total =
VAR _count =
SUM ( 'Table'[Count of Room] )
VAR _total =
CALCULATE ( SUM ( 'Table'[Count of Room] ), ALL ( 'Table' ) )
RETURN
DIVIDE ( _count, _total )
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Assume you have measure M1
then
divide([M1], calculate([M1], allselected())
or all(Table) will give % of grand total
divide([M1], calculate([M1], allexcept(Table, Table[Region]))
, Will use only region filter and give % of region total
divide([M1], calculate([M1], filter(allselected(Table), Table[Region] = max(Table[Region])))
same as above , slicer filter will be used
Percent of Total- https://www.youtube.com/watch?v=uO3ojDPOpcg&list=PLPaNVDMhUXGZNyKU0PgG2g3P0c6CPjMnj&index=7
muchas gracias por tu respuesta! probé todo lo que mencionas pero sigue sin darme el porcentaje correcto, creo que no es precisamente de un 'total general' (o si hubiese algún problema relacional), pero al calcular una medida aparte del total correcto y visualizarlo en una tarjeta, este valor es correcto, por lo que el problema resultaría al momento de hacer la división para el cálculo del % dentro de la matriz.
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |