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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jcgutierro
Frequent Visitor

Registro anterior Power Query M

Hola a tod@s.

Tengo una query con 120 mil. registros, he creado un Índice para numerar el registro actual y lo utilizo para recuperar el registro anterior a través de =RegistroAnterior[Fecha]{[Índice]-1} .Captura1.jpgAl ejecutar lo explicado, llega a tardar 6 minutos en mostrar el dato.

¿Pueden decirme alguna opción o solución que agilice la query en Power Query M?

 

 

 

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @jcgutierro 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
 
Best Regards
Maggie
v-juanli-msft
Community Support
Community Support

Hi @jcgutierro 

It seems your code(RegistroAnterior[Fecha]{[Índice]-1}) would iterate every row for mutiple times.

There is an easy way to achieve the goal: find the previous date for each ID.

https://www.youtube.com/watch?v=xN2IRXQ2CvI

 

If these method still slow for your scenario, try to speed up it with Table.buffer, List.generate,,ect

Performance tip for List.Generate (1): Buffer your tables in Power BI and Power Query

Table.Buffer for cashing intermediate query results or how workaround Unnecessary Queries Issue

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.