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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
hcze
Helper II
Helper II

Total de medida calculada

Hola

Tengo una medida de ganancias para calcular la diferencia entre Ingresos y Gastos.

El DAX es

Amount2 - If(MIN(Account[Account]) á "Profit",CALCULATE(SUM('Transaction'[Amount]),ALLSELECTED('Transaction')),SUM('Transaction'[Amount]))
Me gustaría incluir el beneficio en total. El total debe mostrar 0 para la comprobación de control, pero no puedo lograr eso. Esto es lo que tengo hasta ahora.
2020-10-19_9-38-42.jpg
Gracias por ayudar.
CuentaÍndice
Ingresos1
Gasto2
Beneficio3
CuentaCantidad
Ingresos-200
Gasto100
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HOLA @hcze,

Puede utilizar la función lookupvalue para obtener el resultado en función de la cuenta actual:

Measure =
LOOKUPVALUE (
    Transaction[Amount],
    Account[Account], SELECTEDVALUE ( Transaction[Account] ),
    SUM ( Account[Amount] )
)

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HOLA @hcze,

Puede utilizar la función lookupvalue para obtener el resultado en función de la cuenta actual:

Measure =
LOOKUPVALUE (
    Transaction[Amount],
    Account[Account], SELECTEDVALUE ( Transaction[Account] ),
    SUM ( Account[Amount] )
)

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@hcze , si tiene tabla como la última (Tabla2), Entonces mejor crear una tabla como esta y unirse con la tabla de cuenta

Unión( Tabla 2,
resume(Tabla 2, "Cuenta", "Beneficio", "Importe", suma(Tabla2[Importe])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
samdthompson
Memorable Member
Memorable Member

algo así como :

Importe2

Transacción deVARTM SUM('Transaction'[Amount])

Ingresos de VAR:calcular(transacción,filtro(cuenta,[cuenta]-"ingresos"))

Var Expense-calculate(transaction,filter(account,[account]-"expense"))

Ganancias del VAR-Ingresos+Gastos

devolución
•IF(HASONEVALUE(account[account]),transaction,Revenue+Expense-Profit)

// if this is a solution please mark as such. Kudos always appreciated.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors
Top Kudoed Authors