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
javierarandapa
Frequent Visitor

Last Date prev. other date

Hi all, 

 

I've this table: powerbi.PNG

I'm only interested on save the LastDate from 'Fecha Compra' before 'Fecha inicio' for each 'Identificacion' and 'Medicina'. I mean, for this capture, the only one interests me to save is the one that has 'Fecha Compra' = 26/09/2016. How can i do this?

 

Thanks.

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @javierarandapa,

 

In your scenario, you can duplicate the query, add a custom column to decide whether the [FechaCompra] <= [Fecha inicio] then user Group By feature to return maximum date of [FechaCompra]. Then use Merge Queries to merge those two queries based on [FechaCompra]. For more information, check attached .pbix file.

 

q3.PNGq4.PNG

 

 

Best Regards,
Qiuyun Yu

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

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @javierarandapa,

 

In your scenario, you can duplicate the query, add a custom column to decide whether the [FechaCompra] <= [Fecha inicio] then user Group By feature to return maximum date of [FechaCompra]. Then use Merge Queries to merge those two queries based on [FechaCompra]. For more information, check attached .pbix file.

 

q3.PNGq4.PNG

 

 

Best Regards,
Qiuyun Yu

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

Thanks a lot. 

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!

November Carousel

Fabric Community Update - November 2024

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

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.