This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Comunidad de Hi Power BI 🙂
Tengo esta relación, dim_accounting_accounts ( id ) está relacionado con fact_accounting_transactions ( credit_account_id (activo) y debit_account_id (deactive))
Quiero SUMAR fact_accounting_transaction ( cantidad ) donde dim_accounting_accounts ( account_type_id ) es X para fact_transaction_accounts (credit_account_id) y dim_accounting_accounts ( account_type_id ) es Y para fact_transaction_accounts (debit_account_id).
¿Alguna sugerencia?
Por favor, pruebe la medida.
Measure =
VAR tab1 =
CALCULATETABLE (
fact_accounting_transactions,
dim_accounting_accounts[account_type_id] = "x"
)
VAR tab2 =
CALCULATETABLE (
fact_accounting_transactions,
dim_accounting_accounts[account_type_id] = "y",
USERELATIONSHIP ( dim_accounting_accounts[id], fact_accounting_transactions[debit_account_id] )
)
RETURN
CALCULATE (
SUM ( fact_accounting_transactions[amount] ),
INTERSECT ( tab1, tab2 )
)
Si el problema aún no se resuelve, proporcione información detallada sobre el error o el resultado esperado que espera. Hágamelo saber de inmediato, esperando su respuesta.
Saludos
Winniz
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
Puedo hacer esto de esta manera, pero no quiero agregar columnas de cálculo a mis tablas:
aa_debit_account =
CALCULATE (
MAX ( dim_accounting_accounts[account_type_id] ),
FILTER (
dim_accounting_accounts,
dim_accounting_accounts[id] = fact_accounting_transactions[debit_account_id]
),
USERELATIONSHIP ( dim_accounting_accounts[id], fact_accounting_transactions[debit_account_id] )
)aa_credit_account =
CALCULATE(
MAX(dim_accounting_accounts[account_type_id]),
FILTER(
dim_accounting_accounts, dim_accounting_accounts[id] = fact_accounting_transactions[credit_account_id]))
y después de esta suma (cantidad) donde aa_credit_account = x y aa_debit_account = y.
@odzelashvili1
La relación activa lo hará automáticamente. ¿Probaste mi código? debe dar los resultados deseados.
Por favor, pruebe
=
VAR SumCredit =
SUM ( fact_accounting_transaction[amount] )
VAR SumDebit =
CALCULATE (
SUM ( fact_accounting_transaction[amount] ),
USERELATIONSHIP ( dim_accounting_accounts[id], fact_transaction_accounts[debit_account_id] )
)
RETURN
SumCredit + SumDebit
Esto no es lo que quise decir.
Quiero sumar (cantidad) donde credit_account_id = x y debit_account_id = y al mismo tiempo. Pero esta x e y deben ser filtradas por otra tabla (dim_accounting_accounts) que está relacionada con estas columnas de débito y crédito.
@odzelashvili1
¿Puedes aconsejar cómo se ve tu visual? ¿Cómo se seleccionan X e Y? ¿O simplemente quieres codificar ciertos valores de X e Y?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.