cancel
Showing results 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.

Helper I

## Sumar categorias

Hola

Estoy trabajando con Power BI para crear un estado de perdidas y ganancias, en mi base de datos tengo el listado de las cuentas y el monto de cada una, sin embargo para calcular el margen de ganancia le tengo q restar a las ventas el costo de ventas y posteriormente el resto de gasto, alguien sabe como puedo sumar estas categorias(o restar) para poder generar el margen de utilidad?

1 ACCEPTED SOLUTION
Community Support

Hi,

According to your description, I create a table to test:

1)Create a measure to calculate each Account and Branch’s profit rate:

Profit Rate =

DIVIDE (

CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Sales" )

)

- CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Cost of Sales" )

)

- CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Staff Expenses" )

),

CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Sales" )

)

)

2)Create a measure to check Loss or Profit:

Loss/Profit Status = IF(Profit[Profit rate]<0,"Loss","Profit")

3)The result shows:

Here is my test pbix file:

By the way, please post a reply in English so we can understand the issue better.

Best Regards,

Giotto Zhi

Community Support

Hi,

According to your description, I create a table to test:

1)Create a measure to calculate each Account and Branch’s profit rate:

Profit Rate =

DIVIDE (

CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Sales" )

)

- CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Cost of Sales" )

)

- CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Staff Expenses" )

),

CALCULATE (

MAX ( 'Profit'[Money] ),

FILTER ( 'Profit', 'Profit'[Gral.Account] = "Sales" )

)

)

2)Create a measure to check Loss or Profit:

Loss/Profit Status = IF(Profit[Profit rate]<0,"Loss","Profit")

3)The result shows:

Here is my test pbix file:

By the way, please post a reply in English so we can understand the issue better.

Best Regards,

Giotto Zhi

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors