Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.