Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.