The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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?
Solved! Go to Solution.
Hi,
According to your description, I create a table to test:
Please take following steps:
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
Hi,
According to your description, I create a table to test:
Please take following steps:
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
76 | |
65 | |
52 | |
51 |
User | Count |
---|---|
128 | |
117 | |
78 | |
65 | |
63 |