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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FrancoIVM
New Member

Utilice la fecha de fila actual

Hola

Quiero calcular el último precio de un filtro de columna por fecha, pero quiero que las fechas que se están evaluando terminen en la fecha actual de la fila.

algo así como:

Ultimo precio bt - CALCULATE(
LASTNONBLANKVALUE(
tabla[fechas],
SUM(table[prices])),
DATESBETWEEN(table[dates],FIRSTDATE(table[dates]),
"""end_date"""))
Quiero que end_date puede ser la fecha de la fila actual si eso es posible. Como:
Mesa:
[Fechas] [Precio] [Último precio] [Último precio bt]
1-1-1 100 150 100
1-1-2 150 100
1-1-3 150 100
1-1-4 120 150 120
1-1-5 150 150 150
1 ACCEPTED SOLUTION
DataZoe
Employee
Employee

Hola @FrancoIVM, por favor pruebe esta medida:

Precio anterior ?
CALCULAR (
LASTNONBLANKVALUE (
'Tabla'[Fechas],
[Precio unitario]
),
FILTRO (
ALLSELECTED ( 'Tabla'[Fechas] ),
ISONORAFTER (
'Tabla'[Fechas], MAX ( 'Tabla'[Fechas] ), DESC
)
)
)

DataZoe_0-1601943948717.png

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

1 REPLY 1
DataZoe
Employee
Employee

Hola @FrancoIVM, por favor pruebe esta medida:

Precio anterior ?
CALCULAR (
LASTNONBLANKVALUE (
'Tabla'[Fechas],
[Precio unitario]
),
FILTRO (
ALLSELECTED ( 'Tabla'[Fechas] ),
ISONORAFTER (
'Tabla'[Fechas], MAX ( 'Tabla'[Fechas] ), DESC
)
)
)

DataZoe_0-1601943948717.png

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.