Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hola a todos,
Tengo una tabla con saldos de clientes en una línea de tiempo. Ahora quiero mostrar cómo se ha desarrollado el saldo a lo largo del tiempo, por cliente, en una columna calculada.
Por ejemplo, tengo esta tabla denominada CustomerTransactions:
Ficha de transición del cliente columna deseada
112 1-1-2020 500 500
112 1-5-2020 900 1400
112 4-5-2020 -200 1200
113 1-1-2020 400 400
113 2-5-2020 -900 -500
113 8-5-2020 300 -200
¿Alguien sabe cómo conseguir esta 'columna del deseo'? ¡Gracias!
Hola, @Tamerlane
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Mesa:
Puede crear una columna calculada o una medida como se indica a continuación.
Columna calculada:
Result Column =
var _customer = [Customer]
var _transdate = [Transdate]
return
CALCULATE(
SUM('Table'[Balance]),
FILTER(
ALL('Table'),
'Table'[Customer]=_customer&&
'Table'[Transdate]<=_transdate
)
)
Medida:
Result Measure =
var tab =
ADDCOLUMNS(
'Table',
"Result",
var _customer = [Customer]
var _transdate = [Transdate]
return
CALCULATE(
SUM('Table'[Balance]),
FILTER(
ALL('Table'),
'Table'[Customer]=_customer&&
'Table'[Transdate]<=_transdate
)
)
)
return
SUMX(
tab,
[Result]
)
Resultado:
Saludos
Allan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
como nueva columna
Columna deseada, SUMX(filter(all(Table),Table[Transdate] <-earlier(Table[Transdate]) && Table[Customer] ?earlier(Table[Customer])),Sales[Balance])
Como nueva medida
Medida deseada: CALCULATE(SUM(Sales[Balance]),filter(all(Table),Table[Transdate] <-max(Table[Transdate]) && Table[Customer] -max(Table[Customer])))
@Tamerlane comprobar este post.
Me gustaría❤ elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!
⚡Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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.