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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Cálculo de %

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!

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

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 )

vangzhengmsft_0-1623992560305.png

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.

View solution in original post

3 REPLIES 3
v-angzheng-msft
Community Support
Community Support

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 )

vangzhengmsft_0-1623992560305.png

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.

amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.