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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
myou
Helper II
Helper II

Convertir fórmula de Excel a DAX

Hola

Tengo esta tabla en Excel Contiene

1. Fecha

2. Col1 es una columna fija

3. Col3 es una columna fija

Quiero calcular Col2 y Col4

Cap1.PNG

Comenzando con Col2

1. Col2 Comienza con el mismo valor en B2 (porque no hay nada en los valores anteriores)

2. A continuación, en el mes 2, C3 a B3+C2 - D3 a 4

Sé cómo acceder al valor anterior en DAX, pero no ayudaré mucho

CALCULATE(
sum(Table[Col1]),
PREVIOUSMONTH(Table[Date]),
)

Problema Persiste en los pasos a continuación( en Month3) , ahora quiero usar valores que se calcularon en el paso anterior

Cap2.PNG

¿Cómo puedo hacerlo en DAX para las celdas resaltadas?

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hola @myou,

Parece un simple total rodante de campos [B] -[D] con una condición menor o igual que la fila actual. Puede crear columnas calculadas con las siguientes fórmulas para lograr sus requisitos:

C =
SUMX (
    FILTER ( 'Table', [Date] <= EARLIER ( 'Table'[Date] ) ),
    [B] - [D]
)

E = Table[C]-Table[D]

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

@myou , prefieren usar un calendario de fechas y tomar mes a partir de ese

Cumm ?
CALCULATE(SUM(Table[B]),filter(date,date[date] <-max(Table[Date]))) // O el primer valor de B
+ CALCULATE(SUM(Table[C]),filter(date,date[date] <-max(Table[Date])))
-CALCULATE(SUM(Table[D]),filter(date,date[date] <-max(Table[Date])))

Todos son totales acumulados. El de B puede el primer valor

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

@amitchandak

¿Por qué Table[C] se repite dos veces?

@myou , se ha actualizado la publicación. Tiene que ser la columna D

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

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors