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
Luiz
New Member

Cree una nueva columna de precio con la fecha anterior para un mismo nombre de producto

Hola

Quiero decir, me gustaría insertar una columna "Precio de fecha anterior" para el mismo producto, en esta tabla

Luiz_0-1600367271909.png

Gracias.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Luiz , Pruebe una nueva columna como

nueva columna ?
var _date á maxx(filter(Table, [product] ?earlier([product]) && [Date] <earlier([Date])),[Fecha])
devolución
var _date á maxx(filter(Table, [product] ?earlier([product]) && [Date] ?_date ),[price])

o el conjunto de estas dos columnas

la última fecha ?
maxx(filter(Table, [product] ?earlier([product]) && [Date] <earlier([Date])),[Date])

ultimo precio ?
maxx(filter(Table, [product] á earlier([product]) && [Date] ?earlier([last Date])),[price])

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hola

Pruebe esta fórmula de columna calculada

•lookupvalue(data[Price],data[date],calculate(max(Data[Date]),filter(Data,Data[Date]<earlier(Data[Date])&&&Data[Product]-earlier(Data[Product]))),data[product],data[product])

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Luiz , Pruebe una nueva columna como

nueva columna ?
var _date á maxx(filter(Table, [product] ?earlier([product]) && [Date] <earlier([Date])),[Fecha])
devolución
var _date á maxx(filter(Table, [product] ?earlier([product]) && [Date] ?_date ),[price])

o el conjunto de estas dos columnas

la última fecha ?
maxx(filter(Table, [product] ?earlier([product]) && [Date] <earlier([Date])),[Date])

ultimo precio ?
maxx(filter(Table, [product] á earlier([product]) && [Date] ?earlier([last Date])),[price])

¡Funciona! ¡Muchas gracias!

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.